orderrouter

package
v0.0.0-...-f2cd14d Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2016 License: GPL-3.0 Imports: 10 Imported by: 2

Documentation

Overview

Serving order New/Cancel/Replace tasks, communicates with various market connectors

Index

Constants

View Source
const (
	// DefaultMessageBusURL is the default MessageBus URL for service communications.
	DefaultMessageBusURL        = messagebus.DefaultUrl
	DefaultServiceMessageBusURL = messagebus.DefaultUrl
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	MessageBusURL        string `json:"or_message_bus"`      //trade and order message bus URL
	ServiceMessageBusURL string `json:"service_message_bus"` //services message bus URL, for listening to MC heartbeats
	DatabaseDriver       string `json:"database_driver"`     //database storage engine driver
	DatabaseUrl          string `json:"database_url"`        //database connection string
}

Config represents the configuration for base service.

func NewConfig

func NewConfig() Config

NewConfig returns an instance of Config with defaults.

type OrderRequest

type OrderRequest struct {
	ReplyAddr   string
	RequestType ReqType
	Request     interface{}
	OrderId     int32
}

type OrderRouter

type OrderRouter struct {
	Config Config
	// contains filtered or unexported fields
}

func NewOrderRouter

func NewOrderRouter(c Config) *OrderRouter

Initialise OrderRouter instance and set up topic subscribers

func (*OrderRouter) Close

func (self *OrderRouter) Close()

func (*OrderRouter) Start

func (self *OrderRouter) Start()

start the logic spinning code for OrderRouter, using a single for..select.. pattern so there is no need to lock resources hence to avoid synchronisation issues

type ReqType

type ReqType int
const (
	REQ_NEW ReqType = iota
	REQ_CANCEL
	REQ_REPLACE
)

Jump to

Keyboard shortcuts

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