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

	return s
}
Ejemplo n.º 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
}
Ejemplo n.º 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
}