server

package
v0.0.0-...-03f22b7 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2017 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AttachClient

func AttachClient(server *Server, conn *websocket.Conn)

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is a middleman between the websocket connection and the server.

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server operates with websocket clients (viewers). Listens for aggregated messages from aggreagtor, calculates values for ticker string an build it. Broadcasts updated ticker string to all clients.

func New

func New(aggr *feed.Aggregator) *Server

Instantiate Server

func (*Server) Run

func (s *Server) Run()

Run registers/deregisters websocket clients. Listens for tick messages from aggregator. Calculates and updates ticker string. Pushes to websocket updated ticker string.

func (*Server) Serve

func (s *Server) Serve()

func (*Server) Wait

func (s *Server) Wait()

Jump to

Keyboard shortcuts

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