Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Coon ¶
type Coon struct { Srv *Server // 服务对象 Sock Socket // socket连接对象 State int // 连接状态 Type int // 连接类型 Next *Coon // 链表下一条 Use *Tube // 当前连接use的tube TickAt int64 TickPos int InCoons int SoonestJob *Job // 快到期job Rw byte // 连接类型('r':读 'w':写, '0':从epoll踢出) PendingTimeout int // 连接阻塞超时时间 HalfClosed bool // 连接断开 Cmd []byte // cmd命令数据 CmdLen int // cmd长度 CmdRead int // cmd当前读取长度 Reply []byte // 回复给客户端的数据 ReplyLen int64 // 数据长度 ReplySent int64 // 已经发送的长度 ReplyBuf []byte InJobRead int64 InJob *Job OutJob *Job OutJobSent int64 Watch *structure.Ms ReservedJobs *Job }
Coon 连接对象
type JobRec ¶
type JobRec struct { ID uint64 Pri uint32 Delay int64 TTR int64 BodySize int64 CreateAt int64 // deadline_at is a timestamp, in nsec, that points to: // * time when job will become ready for delayed job, // * time when TTR is about to expire for reserved job, // * undefined otherwise. DeadlineAt int64 ReserveCt uint32 TimeoutCt uint32 ReleaseCt uint32 BuryCt uint32 KickCt uint32 State byte }
type Server ¶
type Server struct { Options ServerOptions Wal Wal Sock *Socket Connes *structure.Heap }
type ServerOption ¶
type ServerOption func(*ServerOptions)
type ServerOptions ¶
type Socket ¶
type Socket struct { F *os.File // 打开文件 Ln net.Listener // 监听器 H Handle // 处理函数 X interface{} // 服务器对象|Conn Added bool // 是否已经添加到epoll AddedFilter int16 // 监听类型 }
Socket socket连接信息 以及listener接口
type Tube ¶
type Tube struct { Name string Ready *structure.Heap Delay *structure.Heap WaitingConns *structure.Ms // 等待在该tube上的客户端连接 Stat State // job各个状态统计 UsingCt int // tube正在被多少coon监听 WatchingCt int // tube上watching的coon Pause int64 // 暂停时间,单位nsec,pause-tube 命令设置 UnpauseAt int64 // 暂停结束时间的时间戳 Buried *Job // 休眠状态job链表 }
Click to show internal directories.
Click to hide internal directories.