Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type WriteLoop ¶
type WriteLoop[Message any] struct { // contains filtered or unexported fields }
WriteLoop 写循环
- 用于将数据并发安全的写入到底层连接
func NewWriteLoop ¶
func NewWriteLoop[Message any](pool *concurrent.Pool[Message], writeHandle func(message Message) error, errorHandle func(err any)) *WriteLoop[Message]
NewWriteLoop 创建写循环
- pool 用于管理 Message 对象的缓冲池,在创建 Message 对象时也应该使用该缓冲池,以便复用 Message 对象。 WriteLoop 会在写入完成后将 Message 对象放回缓冲池
Click to show internal directories.
Click to hide internal directories.