Documentation ¶
Index ¶
- type ServiceContext
- func (s *ServiceContext) Bucket(subKey string) *comet.Bucket
- func (s *ServiceContext) Buckets() []*comet.Bucket
- func (s *ServiceContext) Connect(c context.Context, p *protocol.Proto) (key string, hb time.Duration, errMsg string, err error)
- func (s *ServiceContext) Disconnect(ctx context.Context, key string) error
- func (s *ServiceContext) Heartbeat(ctx context.Context, key string) error
- func (s *ServiceContext) Operate(ctx context.Context, p *protocol.Proto, ch *comet.Channel, tsk *dtask.Task) error
- func (s *ServiceContext) RandServerHearbeat() time.Duration
- func (s *ServiceContext) Receive(ctx context.Context, key string, p *protocol.Proto) error
- func (s *ServiceContext) Round() *comet.Round
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ServiceContext ¶
type ServiceContext struct { Config config.Config LogicRPC logicclient.Logic // contains filtered or unexported fields }
func NewServiceContext ¶
func NewServiceContext(c config.Config) *ServiceContext
func (*ServiceContext) Bucket ¶
func (s *ServiceContext) Bucket(subKey string) *comet.Bucket
Bucket get the bucket by subkey.
func (*ServiceContext) Buckets ¶
func (s *ServiceContext) Buckets() []*comet.Bucket
Buckets return all buckets.
func (*ServiceContext) Connect ¶
func (s *ServiceContext) Connect(c context.Context, p *protocol.Proto) (key string, hb time.Duration, errMsg string, err error)
Connect connected a connection.
func (*ServiceContext) Disconnect ¶
func (s *ServiceContext) Disconnect(ctx context.Context, key string) error
Disconnect disconnected a connection.
func (*ServiceContext) Heartbeat ¶
func (s *ServiceContext) Heartbeat(ctx context.Context, key string) error
Heartbeat a connection session.
func (*ServiceContext) Operate ¶
func (s *ServiceContext) Operate(ctx context.Context, p *protocol.Proto, ch *comet.Channel, tsk *dtask.Task) error
Operate operate.
func (*ServiceContext) RandServerHearbeat ¶
func (s *ServiceContext) RandServerHearbeat() time.Duration
RandServerHearbeat rand server heartbeat.
func (*ServiceContext) Round ¶
func (s *ServiceContext) Round() *comet.Round
Round return all round.
Click to show internal directories.
Click to hide internal directories.