server

package
v0.0.0-...-301ae46 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2015 License: AGPL-3.0 Imports: 8 Imported by: 1

Documentation

Overview

Contains the ZeroMQ server loop. Deals with incoming requests and delegates them to the event store. Also publishes newly stored events using a PUB socket.

See README file for an up-to-date documentation of the ZeroMQ wire format.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InitParams

type InitParams struct {
	// The event store to use as backend.
	Store *eventstore.EventStore
	// The ZeroMQ path that the command receiving socket will bind
	// to.
	CommandSocketZPath *string
	// The ZeroMQ path that the event publishing socket will bind
	// to.
	EvPubSocketZPath *string
	// ZeroMQ context to use. While the context potentially could be
	// instantiated by Server, it is not. Otherwise, it wuold be
	// impossible to use inproc:// endpoints.
	ZMQContext *zmq.Context
}

StartParams are parameters required for starting the server.

type Server

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

A server instance. Can be run.

func New

func New(params *InitParams) (*Server, error)

Initialize a new event store server and return a handle to it. The event store is not started. It's up to the caller to execute Run() on the server handle.

func (*Server) Close

func (v *Server) Close() error

Clean up and server and deallocate resources.

func (*Server) IsRunning

func (v *Server) IsRunning() bool

IsRunning returns true if the server is running, false otherwise.

func (*Server) Start

func (v *Server) Start() error

Runs the server that distributes requests to workers. Panics on error since it is an essential piece of code required to run the application correctly.

func (*Server) Stop

func (v *Server) Stop() error

Stop stops a running server. Blocks until the server is stopped. If the server is not running, an error is returned.

Call Server.Close() if you are done with the server.

func (*Server) Wait

func (v *Server) Wait()

Jump to

Keyboard shortcuts

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