Documentation
¶
Index ¶
- type Hub
- func (h *Hub) AddSession(session HubSession)
- func (h *Hub) Broadcast(stream string, data string)
- func (h *Hub) BroadcastMessage(msg *common.StreamMessage)
- func (h *Hub) DisconnectSesssions(msg encoders.EncodedMessage, code string)
- func (h *Hub) FindByIdentifier(id string) HubSession
- func (h *Hub) RemoteDisconnect(msg *common.RemoteDisconnectMessage)
- func (h *Hub) RemoveSession(session HubSession)
- func (h *Hub) RemoveSessionLater(s HubSession)
- func (h *Hub) Run()
- func (h *Hub) Shutdown()
- func (h *Hub) Size() int
- func (h *Hub) StreamsSize() int
- func (h *Hub) SubscribeSession(sid string, stream string, identifier string)
- func (h *Hub) UniqSize() int
- func (h *Hub) UnsubscribeSession(sid string, stream string, identifier string)
- func (h *Hub) UnsubscribeSessionFromChannel(sid string, identifier string)
- type HubRegistration
- type HubSession
- type HubSubscription
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Hub ¶
type Hub struct {
// contains filtered or unexported fields
}
Hub stores all the sessions and the corresponding subscriptions info
func (*Hub) AddSession ¶
func (h *Hub) AddSession(session HubSession)
func (*Hub) BroadcastMessage ¶
func (h *Hub) BroadcastMessage(msg *common.StreamMessage)
BroadcastMessage enqueues broadcasting a pre-built StreamMessage
func (*Hub) DisconnectSesssions ¶
func (h *Hub) DisconnectSesssions(msg encoders.EncodedMessage, code string)
func (*Hub) FindByIdentifier ¶
func (h *Hub) FindByIdentifier(id string) HubSession
func (*Hub) RemoteDisconnect ¶
func (h *Hub) RemoteDisconnect(msg *common.RemoteDisconnectMessage)
RemoteDisconnect enqueues remote disconnect command
func (*Hub) RemoveSession ¶
func (h *Hub) RemoveSession(session HubSession)
func (*Hub) RemoveSessionLater ¶
func (h *Hub) RemoveSessionLater(s HubSession)
RemoveSession enqueues session un-registration
func (*Hub) StreamsSize ¶
StreamsSize returns a number of uniq streams
func (*Hub) SubscribeSession ¶
func (*Hub) UnsubscribeSession ¶
func (*Hub) UnsubscribeSessionFromChannel ¶
type HubRegistration ¶
type HubRegistration struct {
// contains filtered or unexported fields
}
HubRegistration represents registration event ("add" or "remove")
type HubSession ¶
type HubSession interface {
GetID() string
GetIdentifiers() string
Send(msg encoders.EncodedMessage)
DisconnectWithMessage(msg encoders.EncodedMessage, code string)
}
type HubSubscription ¶
type HubSubscription struct {
// contains filtered or unexported fields
}
HubSubscription contains information about session-channel(-stream) subscription
Click to show internal directories.
Click to hide internal directories.