Documentation ¶
Index ¶
Constants ¶
View Source
const ( MessageTypeConnectionInit = "connection_init" MessageTypeConnectionAck = "connection_ack" MessageTypeConnectionError = "connection_error" MessageTypeConnectionTerminate = "connection_terminate" MessageTypeConnectionKeepAlive = "ka" MessageTypeStart = "start" MessageTypeStop = "stop" MessageTypeData = "data" MessageTypeError = "error" MessageTypeComplete = "complete" DefaultKeepAliveInterval = "15s" DefaultSubscriptionUpdateInterval = "1s" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { // ReadFromClient will invoke a read operation from the client connection. ReadFromClient() (*Message, error) // WriteToClient will invoke a write operation to the client connection. WriteToClient(Message) error // IsConnected will indicate if a connection is still established. IsConnected() bool // Disconnect will close the connection between server and client. Disconnect() error }
client provides an interface which can be implemented by any possible subscription client like websockets, mqtt, etc.
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler is the actual subscription handler which will keep track on how to handle messages coming from the client.
func NewHandler ¶
func NewHandler(logger abstractlogger.Logger, client Client, executionHandler *execution.Handler) (*Handler, error)
NewHandler creates a new subscription handler.
func (*Handler) ActiveSubscriptions ¶
ActiveSubscriptions will return the actual number of active subscriptions for that client.
func (*Handler) ChangeKeepAliveInterval ¶
ChangeKeepAliveInterval can be used to change the keep alive interval.
func (*Handler) ChangeSubscriptionUpdateInterval ¶
ChangeSubscriptionUpdateInterval can be used to change the update interval.
Click to show internal directories.
Click to hide internal directories.