Example #1
0
func NewServer(allocator *TableAllocator, client *shttp.WSAsyncClient) *TableServer {
	s := &TableServer{
		TableAllocator: allocator,
		WSAsyncClient:  client,
	}
	client.AddEventHandler(s)

	return s
}
Example #2
0
func NewForwarder(c *shttp.WSAsyncClient, g *Graph, host string) *Forwarder {
	f := &Forwarder{
		Client: c,
		Graph:  g,
		Host:   host,
	}

	g.AddEventListener(f)
	c.AddEventHandler(f)

	return f
}
Example #3
0
func NewForwarder(c *shttp.WSAsyncClient, g *Graph, root *Node) *Forwarder {
	f := &Forwarder{
		Client: c,
		Graph:  g,
		Root:   root,
	}

	g.AddEventListener(f)
	c.AddEventHandler(f)

	return f
}