web

package
v0.0.0-...-59476ba Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 12, 2018 License: MIT Imports: 9 Imported by: 5

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

func WsServer

func WsServer(port string, ws string)

WsServer is the process launched by `abm-cp` program by default `run` command soon will be

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL