This section is empty.


View Source
var (
	// ErrComet commet error.
	ErrComet = errors.New("comet rpc is not available")
	// ErrCometFull comet chan full.
	ErrCometFull = errors.New("comet proto chan full")
	// ErrRoomFull room chan full.
	ErrRoomFull = errors.New("room proto chan full")


This section is empty.


type Comet

type Comet struct {
	// contains filtered or unexported fields

    Comet is a comet.

    func NewComet

    func NewComet(in *naming.Instance, c *conf.Comet) (*Comet, error)

      NewComet new a comet.

      func (*Comet) Broadcast

      func (c *Comet) Broadcast(arg *comet.BroadcastReq) (err error)

        Broadcast broadcast a message.

        func (*Comet) BroadcastRoom

        func (c *Comet) BroadcastRoom(arg *comet.BroadcastRoomReq) (err error)

          BroadcastRoom broadcast a room message.

          func (*Comet) Close

          func (c *Comet) Close() (err error)

            Close close the resouces.

            func (*Comet) Push

            func (c *Comet) Push(arg *comet.PushMsgReq) (err error)

              Push push a user message.

              type Job

              type Job struct {
              	// contains filtered or unexported fields

                Job is push job.

                func New

                func New(c *conf.Config) *Job

                  New new a push job.

                  func (*Job) Close

                  func (j *Job) Close() error

                    Close close resounces.

                    func (*Job) Consume

                    func (j *Job) Consume()

                      Consume messages, watch signals

                      type Room

                      type Room struct {
                      	// contains filtered or unexported fields

                        Room room.

                        func NewRoom

                        func NewRoom(job *Job, id string, c *conf.Room) (r *Room)

                          NewRoom new a room struct, store channel room info.

                          func (*Room) Push

                          func (r *Room) Push(op int32, msg []byte) (err error)

                            Push push msg to the room, if chan full discard it.


                            Path Synopsis