Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Users = make(map[string]abm.Client)
Users the global mutable index of current abm-cp users.
Functions ¶
Types ¶
type SocketClient ¶
type SocketClient struct { *websocket.Conn UUID string Name string *abm.Model // contains filtered or unexported fields }
SocketClient wraps the Model, bridging it to the WebSocket user connection.
func NewSocketClient ¶
func NewSocketClient(ws *websocket.Conn, uuid string, params json.RawMessage) SocketClient
NewSocketClient constructor
func (*SocketClient) Dead ¶
func (c *SocketClient) Dead() bool
Dead implements Client interface method for SocketClient
func (*SocketClient) Monitor ¶
func (c *SocketClient) Monitor(ch chan struct{})
Monitor keeps the client's connection alive, and responds to any internal running model signaling – e.g. if there is a fault in the running abm, or if the population of the CP Prey agents reaches zero, then the model will invoke Kill() and Quit will close, which permits us to clean up and disconnect the SocketClient. Implements abm.Client interface method for SocketClient.
func (*SocketClient) TimeStamp ¶
func (c *SocketClient) TimeStamp() time.Time
TimeStamp implement Client interface method for SocketClient
Click to show internal directories.
Click to hide internal directories.