Documentation ¶
Index ¶
- Constants
- Variables
- func BlockMessage(payload, priv []byte) []byte
- func BlockReqMessage(payload, priv []byte) []byte
- func BlockResMessage(payload, priv []byte) []byte
- func CancelMessage(priv []byte) []byte
- func ConnFullMessage() []byte
- func HelloMessage(payload []byte) []byte
- func InvalidMessage() []byte
- func InvalidSignature() []byte
- func JobMessage(payload, priv []byte) []byte
- func ParseAddr(addr string) (map[string]interface{}, error)
- func PeerConnectMessage(payload, priv []byte) []byte
- func PeerDisconnectMessage(payload, priv []byte) []byte
- func ResultMessage(payload, priv []byte) []byte
- func ShutAckMessage(priv []byte) []byte
- func ShutMessage(priv []byte) []byte
- type Centrum
- func (c Centrum) ConnectWorker() (map[string]interface{}, error)
- func (c Centrum) DisconnectWorker() (map[string]interface{}, error)
- func (c Centrum) GetDispatchers() map[string]interface{}
- func (c Centrum) GetToken() string
- func (c *Centrum) NewDisptcher(pub, ip string, port int) error
- func (c *Centrum) SetToken(token string)
- func (c Centrum) Sleep() (map[string]interface{}, error)
- func (c Centrum) Wake() (map[string]interface{}, error)
- type Dispatcher
- func (d *Dispatcher) AddJob(j job.Job)
- func (d *Dispatcher) AddPeer(s interface{}, n *DispatcherInfo)
- func (d Dispatcher) Batch(jrs []string, callbackJr string) (string, error)
- func (d Dispatcher) BlockByHash(hash string) (string, error)
- func (d Dispatcher) BlockByHeight(height int) (string, error)
- func (d Dispatcher) BlockHashesHex() []string
- func (d Dispatcher) BroadcastPeers(m []byte)
- func (d Dispatcher) BroadcastWorkers(m []byte)
- func (d Dispatcher) CancelExec(hash []byte) error
- func (d Dispatcher) Chain(jrs []string, callbackJr string) (string, error)
- func (d Dispatcher) Chord(jrs []string, callbackJr string) (string, error)
- func (d *Dispatcher) EmptyJobs()
- func (d Dispatcher) ExecArgs(id string, hash []byte) ([]interface{}, error)
- func (d Dispatcher) ExecBackoff(id string, hash []byte) (float64, error)
- func (d Dispatcher) ExecBy(id string, hash []byte) (string, error)
- func (d Dispatcher) ExecDurationMinutes(id string, hash []byte) (float64, error)
- func (d Dispatcher) ExecDurationNanoseconds(id string, hash []byte) (int64, error)
- func (d Dispatcher) ExecDurationSeconds(id string, hash []byte) (float64, error)
- func (d Dispatcher) ExecDurationString(id string, hash []byte) (string, error)
- func (d Dispatcher) ExecErr(id string, hash []byte) (interface{}, error)
- func (d Dispatcher) ExecExecutionTime(id string, hash []byte) (int64, error)
- func (d Dispatcher) ExecExecutionTimeString(id string, hash []byte) (string, error)
- func (d Dispatcher) ExecInterval(id string, hash []byte) (int, error)
- func (d Dispatcher) ExecPriority(id string, hash []byte) (int, error)
- func (d Dispatcher) ExecResult(id string, hash []byte) (interface{}, error)
- func (d Dispatcher) ExecRetries(id string, hash []byte) (int, error)
- func (d Dispatcher) ExecStatus(id string, hash []byte) (string, error)
- func (d Dispatcher) ExecTimestamp(id string, hash []byte) (int64, error)
- func (d Dispatcher) ExecTimestampString(id string, hash []byte) (string, error)
- func (d Dispatcher) ExecTtlHours(id string, hash []byte) (float64, error)
- func (d Dispatcher) ExecTtlMinutes(id string, hash []byte) (float64, error)
- func (d Dispatcher) ExecTtlNanoseconds(id string, hash []byte) (int64, error)
- func (d Dispatcher) ExecTtlSeconds(id string, hash []byte) (float64, error)
- func (d Dispatcher) ExecTtlString(id string, hash []byte) (string, error)
- func (d Dispatcher) GetAssignedWorker(hash []byte) *melody.Session
- func (d Dispatcher) GetBC() *core.BlockChain
- func (d Dispatcher) GetBench() benchmark.Engine
- func (d Dispatcher) GetBenchmarks() []benchmark.Benchmark
- func (d Dispatcher) GetDWS() *melody.Melody
- func (d *Dispatcher) GetDispatchersAndSync()
- func (d Dispatcher) GetIP() string
- func (d Dispatcher) GetJC() *cache.JobCache
- func (d Dispatcher) GetJobPQ() *queue.JobPriorityQueue
- func (d Dispatcher) GetJobs() []job.Job
- func (d Dispatcher) GetPeer(n interface{}) *DispatcherInfo
- func (d Dispatcher) GetPeers() map[interface{}]*DispatcherInfo
- func (d Dispatcher) GetPeersPubs() []string
- func (d Dispatcher) GetPort() int
- func (d Dispatcher) GetPrivByte() []byte
- func (d Dispatcher) GetPrivString() string
- func (d Dispatcher) GetPubByte() []byte
- func (d Dispatcher) GetPubString() string
- func (d Dispatcher) GetRPC() *rpc.HTTPService
- func (d Dispatcher) GetUptimeString() string
- func (d Dispatcher) GetUptme() int64
- func (d Dispatcher) GetWWS() *melody.Melody
- func (d Dispatcher) GetWorker(s *melody.Session) *WorkerInfo
- func (d Dispatcher) GetWorkerPQ() *WorkerPriorityQueue
- func (d Dispatcher) GetWorkers() map[*melody.Session]*WorkerInfo
- func (d Dispatcher) GetWriteQ() *lane.Queue
- func (d Dispatcher) IsJobPrivate(id string) (bool, error)
- func (d Dispatcher) Job(id string) (string, error)
- func (d Dispatcher) JobExecs(id string) (string, error)
- func (d Dispatcher) JobLatestExec(id string) (string, error)
- func (d Dispatcher) JobName(id string) (string, error)
- func (d Dispatcher) JobQueueCount() int
- func (d Dispatcher) JobSubmisstionTimeString(id string) (string, error)
- func (d Dispatcher) JobSubmisstionTimeUnix(id string) (int64, error)
- func (d Dispatcher) KeyPair() (string, error)
- func (d Dispatcher) Latest15Blocks() (string, error)
- func (d Dispatcher) LatestBlock() string
- func (d Dispatcher) LatestBlockHeight() int
- func (d Dispatcher) MulticastPeers(m []byte, peers []string)
- func (d Dispatcher) NewExec(args []interface{}, retries, priority int, backoff int64, execTime int64, ...) (string, error)
- func (d Dispatcher) NewJob(task string, name string, priv bool, privKey string) (string, error)
- func (d Dispatcher) PeerCount() int
- func (d Dispatcher) Peers() []string
- func (d Dispatcher) PendingCount() int
- func (d Dispatcher) PublicKey() string
- func (d Dispatcher) Register()
- func (d Dispatcher) Rpc()
- func (d Dispatcher) SaveToken()
- func (d Dispatcher) Score() float64
- func (d *Dispatcher) SetIP(ip string)
- func (d *Dispatcher) SetWorker(s *melody.Session, w *WorkerInfo)
- func (d Dispatcher) Solo(jr string) (string, error)
- func (d Dispatcher) Start()
- func (d Dispatcher) Version() string
- func (d Dispatcher) WorkerExists(s *melody.Session) bool
- func (d Dispatcher) WorkersCount() int
- func (d Dispatcher) WorkersCountBusy() int
- func (d Dispatcher) WorkersCountNotBusy() int
- func (d Dispatcher) WriteJobs(jobs []job.Job)
- type DispatcherBody
- type DispatcherInfo
- type PeerMessage
- func (m PeerMessage) GetMessage() string
- func (m PeerMessage) GetPayload() []byte
- func (m PeerMessage) GetSignature() [][]byte
- func (m PeerMessage) Serialize() []byte
- func (m *PeerMessage) SetMessage(message string)
- func (m *PeerMessage) SetPayload(payload []byte)
- func (m *PeerMessage) VerifySignature(pub string) bool
- type Version
- type Worker
- func (w *Worker) Connect()
- func (w *Worker) Dial(url string) error
- func (w Worker) Disconnect()
- func (w Worker) GetBusy() bool
- func (w Worker) GetDispatcher() string
- func (w *Worker) GetDispatchers()
- func (w Worker) GetItem() qItem.Item
- func (w Worker) GetPrivByte() []byte
- func (w Worker) GetPrivString() string
- func (w Worker) GetPubByte() []byte
- func (w Worker) GetPubString() string
- func (w Worker) GetShortlist() []string
- func (w Worker) GetState() string
- func (w Worker) GetUptimeString() string
- func (w Worker) GetUptme() int64
- func (w Worker) NodeTypeDispatcher() bool
- func (w *Worker) SetBusy(b bool)
- func (w *Worker) SetDispatcher(d string)
- func (w *Worker) SetItem(i qItem.Item)
- func (w *Worker) SetShortlist(s []string)
- func (w *Worker) SetState(s string)
- func (w *Worker) Start()
- func (w Worker) WatchInterrupt()
- type WorkerInfo
- func (w *WorkerInfo) Assign(j *qItem.Item)
- func (w *WorkerInfo) Busy() bool
- func (w WorkerInfo) GetJob() *qItem.Item
- func (w WorkerInfo) GetPub() string
- func (w WorkerInfo) GetShut() bool
- func (w *WorkerInfo) SetJob(j *qItem.Item)
- func (w *WorkerInfo) SetPub(pub string)
- func (w *WorkerInfo) SetShut(s bool)
- type WorkerPriorityQueue
Constants ¶
const ( NodeDB = "nodeinfo.db" NodeBucket = "node" DispatcherScheme = "gizo" //FIXME: use better one MaxWorkers = 128 DefaultPort = 9999 CentrumURL = "https://centrum-dev.herokuapp.com" GizoVersion = 1 )
const ( // when a node is not connected to the network DOWN = "DOWN" // worker - when a worker connects to a dispatchers standard area // dispatcher - when an adjacency is created and topology table, peer table and blockchain have not been synced INIT = "INIT" // worker - when a node starts receiving and crunching jobs LIVE = "LIVE" // dispatcher - when an adjacency is created and topology table, peer table and blockchain have been sync FULL = "FULL" )
node states
const ( HELLO = "HELLO" INVALIDMESSAGE = "INVALIDMESSAGE" // invalid message CONNFULL = "CONNFULL" // max workers reached JOB = "JOB" INVALIDSIGNATURE = "JOB" RESULT = "RESULT" SHUT = "SHUT" SHUTACK = "SHUTACK" BLOCK = "BLOCK" BLOCKREQ = "BLOCKREQ" BLOCKRES = "BLOCKRES" PEERCONNECT = "PEERCONNECT" PEERDISCONNECT = "PEERDISCONNECT" CANCEL = "CANCEL" )
Variables ¶
var (
ErrJobsFull = errors.New("Jobs array full")
)
var (
ErrNoDispatchers = errors.New("Centrum: no dispatchers available")
)
var (
ErrNoToken = errors.New("Centrum: No token in struct")
)
Functions ¶
func BlockMessage ¶
func BlockReqMessage ¶
func BlockResMessage ¶
func CancelMessage ¶
func ConnFullMessage ¶
func ConnFullMessage() []byte
func HelloMessage ¶
func InvalidMessage ¶
func InvalidMessage() []byte
func InvalidSignature ¶
func InvalidSignature() []byte
func JobMessage ¶
func PeerConnectMessage ¶
func PeerDisconnectMessage ¶
func ResultMessage ¶
func ShutAckMessage ¶
func ShutMessage ¶
Types ¶
type Centrum ¶
type Centrum struct {
// contains filtered or unexported fields
}
func NewCentrum ¶
func NewCentrum() *Centrum
func (Centrum) ConnectWorker ¶
ConnectWorker increments dispatchers worker in centrum
func (Centrum) DisconnectWorker ¶
DisconnectWorker decrements dispatchers worker in centrum
func (Centrum) GetDispatchers ¶
GetDispatchers returns active dispatchers
func (*Centrum) NewDisptcher ¶
NewDisptcher registers dispatcher in centrum
type Dispatcher ¶
type Dispatcher struct { IP string Port uint //port Pub []byte //public key of the node // contains filtered or unexported fields }
func NewDispatcher ¶
func NewDispatcher(port int) *Dispatcher
func (*Dispatcher) AddJob ¶
func (d *Dispatcher) AddJob(j job.Job)
AddJob keeps job in memory before being written to the bc
func (*Dispatcher) AddPeer ¶
func (d *Dispatcher) AddPeer(s interface{}, n *DispatcherInfo)
func (Dispatcher) Batch ¶
func (d Dispatcher) Batch(jrs []string, callbackJr string) (string, error)
func (Dispatcher) BlockByHash ¶
func (d Dispatcher) BlockByHash(hash string) (string, error)
func (Dispatcher) BlockByHeight ¶
func (d Dispatcher) BlockByHeight(height int) (string, error)
func (Dispatcher) BlockHashesHex ¶
func (d Dispatcher) BlockHashesHex() []string
BlockHashesHex returns hashes of all blocks in the bc
func (Dispatcher) BroadcastPeers ¶
func (d Dispatcher) BroadcastPeers(m []byte)
BroadcastPeers sends message to all peers
func (Dispatcher) BroadcastWorkers ¶
func (d Dispatcher) BroadcastWorkers(m []byte)
BroadcastWorkers sends message to all workers
func (Dispatcher) CancelExec ¶
func (d Dispatcher) CancelExec(hash []byte) error
func (Dispatcher) Chain ¶
func (d Dispatcher) Chain(jrs []string, callbackJr string) (string, error)
func (Dispatcher) Chord ¶
func (d Dispatcher) Chord(jrs []string, callbackJr string) (string, error)
func (*Dispatcher) EmptyJobs ¶
func (d *Dispatcher) EmptyJobs()
func (Dispatcher) ExecArgs ¶
func (d Dispatcher) ExecArgs(id string, hash []byte) ([]interface{}, error)
func (Dispatcher) ExecBackoff ¶
func (d Dispatcher) ExecBackoff(id string, hash []byte) (float64, error)
func (Dispatcher) ExecDurationMinutes ¶
func (d Dispatcher) ExecDurationMinutes(id string, hash []byte) (float64, error)
func (Dispatcher) ExecDurationNanoseconds ¶
func (d Dispatcher) ExecDurationNanoseconds(id string, hash []byte) (int64, error)
func (Dispatcher) ExecDurationSeconds ¶
func (d Dispatcher) ExecDurationSeconds(id string, hash []byte) (float64, error)
func (Dispatcher) ExecDurationString ¶
func (d Dispatcher) ExecDurationString(id string, hash []byte) (string, error)
func (Dispatcher) ExecErr ¶
func (d Dispatcher) ExecErr(id string, hash []byte) (interface{}, error)
func (Dispatcher) ExecExecutionTime ¶
func (d Dispatcher) ExecExecutionTime(id string, hash []byte) (int64, error)
func (Dispatcher) ExecExecutionTimeString ¶
func (d Dispatcher) ExecExecutionTimeString(id string, hash []byte) (string, error)
func (Dispatcher) ExecInterval ¶
func (d Dispatcher) ExecInterval(id string, hash []byte) (int, error)
func (Dispatcher) ExecPriority ¶
func (d Dispatcher) ExecPriority(id string, hash []byte) (int, error)
func (Dispatcher) ExecResult ¶
func (d Dispatcher) ExecResult(id string, hash []byte) (interface{}, error)
func (Dispatcher) ExecRetries ¶
func (d Dispatcher) ExecRetries(id string, hash []byte) (int, error)
func (Dispatcher) ExecStatus ¶
func (d Dispatcher) ExecStatus(id string, hash []byte) (string, error)
func (Dispatcher) ExecTimestamp ¶
func (d Dispatcher) ExecTimestamp(id string, hash []byte) (int64, error)
func (Dispatcher) ExecTimestampString ¶
func (d Dispatcher) ExecTimestampString(id string, hash []byte) (string, error)
func (Dispatcher) ExecTtlHours ¶
func (d Dispatcher) ExecTtlHours(id string, hash []byte) (float64, error)
func (Dispatcher) ExecTtlMinutes ¶
func (d Dispatcher) ExecTtlMinutes(id string, hash []byte) (float64, error)
func (Dispatcher) ExecTtlNanoseconds ¶
func (d Dispatcher) ExecTtlNanoseconds(id string, hash []byte) (int64, error)
func (Dispatcher) ExecTtlSeconds ¶
func (d Dispatcher) ExecTtlSeconds(id string, hash []byte) (float64, error)
func (Dispatcher) ExecTtlString ¶
func (d Dispatcher) ExecTtlString(id string, hash []byte) (string, error)
func (Dispatcher) GetAssignedWorker ¶
func (d Dispatcher) GetAssignedWorker(hash []byte) *melody.Session
GetAssignedWorker returns worker assigned to execute job
func (Dispatcher) GetBC ¶
func (d Dispatcher) GetBC() *core.BlockChain
func (Dispatcher) GetBench ¶
func (d Dispatcher) GetBench() benchmark.Engine
func (Dispatcher) GetBenchmarks ¶
func (d Dispatcher) GetBenchmarks() []benchmark.Benchmark
func (Dispatcher) GetDWS ¶
func (d Dispatcher) GetDWS() *melody.Melody
func (*Dispatcher) GetDispatchersAndSync ¶
func (d *Dispatcher) GetDispatchersAndSync()
GetDispatchersAndSync get's dispatchers from centrum and syncs with the node with the highest verison
func (Dispatcher) GetIP ¶
func (d Dispatcher) GetIP() string
func (Dispatcher) GetJC ¶
func (d Dispatcher) GetJC() *cache.JobCache
func (Dispatcher) GetJobPQ ¶
func (d Dispatcher) GetJobPQ() *queue.JobPriorityQueue
func (Dispatcher) GetJobs ¶
func (d Dispatcher) GetJobs() []job.Job
func (Dispatcher) GetPeer ¶
func (d Dispatcher) GetPeer(n interface{}) *DispatcherInfo
func (Dispatcher) GetPeers ¶
func (d Dispatcher) GetPeers() map[interface{}]*DispatcherInfo
func (Dispatcher) GetPeersPubs ¶
func (d Dispatcher) GetPeersPubs() []string
func (Dispatcher) GetPort ¶
func (d Dispatcher) GetPort() int
func (Dispatcher) GetPrivByte ¶
func (d Dispatcher) GetPrivByte() []byte
func (Dispatcher) GetPrivString ¶
func (d Dispatcher) GetPrivString() string
func (Dispatcher) GetPubByte ¶
func (d Dispatcher) GetPubByte() []byte
func (Dispatcher) GetPubString ¶
func (d Dispatcher) GetPubString() string
func (Dispatcher) GetRPC ¶
func (d Dispatcher) GetRPC() *rpc.HTTPService
func (Dispatcher) GetUptimeString ¶
func (d Dispatcher) GetUptimeString() string
func (Dispatcher) GetUptme ¶
func (d Dispatcher) GetUptme() int64
func (Dispatcher) GetWWS ¶
func (d Dispatcher) GetWWS() *melody.Melody
func (Dispatcher) GetWorker ¶
func (d Dispatcher) GetWorker(s *melody.Session) *WorkerInfo
func (Dispatcher) GetWorkerPQ ¶
func (d Dispatcher) GetWorkerPQ() *WorkerPriorityQueue
func (Dispatcher) GetWorkers ¶
func (d Dispatcher) GetWorkers() map[*melody.Session]*WorkerInfo
func (Dispatcher) GetWriteQ ¶
func (d Dispatcher) GetWriteQ() *lane.Queue
func (Dispatcher) IsJobPrivate ¶
func (d Dispatcher) IsJobPrivate(id string) (bool, error)
func (Dispatcher) JobLatestExec ¶
func (d Dispatcher) JobLatestExec(id string) (string, error)
func (Dispatcher) JobQueueCount ¶
func (d Dispatcher) JobQueueCount() int
JobQueueCount returns nubmer of jobs waiting to be executed
func (Dispatcher) JobSubmisstionTimeString ¶
func (d Dispatcher) JobSubmisstionTimeString(id string) (string, error)
func (Dispatcher) JobSubmisstionTimeUnix ¶
func (d Dispatcher) JobSubmisstionTimeUnix(id string) (int64, error)
func (Dispatcher) KeyPair ¶
func (d Dispatcher) KeyPair() (string, error)
KeyPair returns new pub and priv keypair
func (Dispatcher) Latest15Blocks ¶
func (d Dispatcher) Latest15Blocks() (string, error)
func (Dispatcher) LatestBlock ¶
func (d Dispatcher) LatestBlock() string
func (Dispatcher) LatestBlockHeight ¶
func (d Dispatcher) LatestBlockHeight() int
func (Dispatcher) MulticastPeers ¶
func (d Dispatcher) MulticastPeers(m []byte, peers []string)
MulticastPeers sends message to specified peers
func (Dispatcher) PeerCount ¶
func (d Dispatcher) PeerCount() int
PeerCount returns the number of peers a node has
func (Dispatcher) Peers ¶
func (d Dispatcher) Peers() []string
Peers returns the public keys of its peers
func (Dispatcher) PendingCount ¶
func (d Dispatcher) PendingCount() int
PendingCount returns number of job waiting to be written to the bc
func (Dispatcher) PublicKey ¶
func (d Dispatcher) PublicKey() string
func (Dispatcher) Register ¶
func (d Dispatcher) Register()
Register registers dispatcher with centrum
func (Dispatcher) Rpc ¶
func (d Dispatcher) Rpc()
func (Dispatcher) SaveToken ¶
func (d Dispatcher) SaveToken()
SaveToken saves token got from centrum to db
func (Dispatcher) Score ¶
func (d Dispatcher) Score() float64
func (*Dispatcher) SetIP ¶
func (d *Dispatcher) SetIP(ip string)
func (*Dispatcher) SetWorker ¶
func (d *Dispatcher) SetWorker(s *melody.Session, w *WorkerInfo)
func (Dispatcher) WorkerExists ¶
func (d Dispatcher) WorkerExists(s *melody.Session) bool
func (Dispatcher) WorkersCount ¶
func (d Dispatcher) WorkersCount() int
func (Dispatcher) WorkersCountBusy ¶
func (d Dispatcher) WorkersCountBusy() int
func (Dispatcher) WorkersCountNotBusy ¶
func (d Dispatcher) WorkersCountNotBusy() int
func (Dispatcher) WriteJobs ¶
func (d Dispatcher) WriteJobs(jobs []job.Job)
WriteJobs writes jobs to the bc
type DispatcherBody ¶
type DispatcherInfo ¶
DispatcherInfo message used to create and maintain adjacency between dispatcher nodes
func DeserializeDispatcherInfo ¶
func DeserializeDispatcherInfo(b []byte) DispatcherInfo
func NewDispatcherInfo ¶
func NewDispatcherInfo(pub []byte, p []string) *DispatcherInfo
func (*DispatcherInfo) AddPeer ¶
func (w *DispatcherInfo) AddPeer(n string)
func (DispatcherInfo) GetPeers ¶
func (d DispatcherInfo) GetPeers() []string
func (DispatcherInfo) GetPub ¶
func (d DispatcherInfo) GetPub() []byte
func (DispatcherInfo) Serialize ¶
func (d DispatcherInfo) Serialize() []byte
func (*DispatcherInfo) SetPeers ¶
func (d *DispatcherInfo) SetPeers(n []string)
func (*DispatcherInfo) SetPub ¶
func (d *DispatcherInfo) SetPub(pub []byte)
type PeerMessage ¶
PeerMessage message sent between nodes
func DeserializePeerMessage ¶
func DeserializePeerMessage(b []byte) PeerMessage
func NewPeerMessage ¶
func NewPeerMessage(message string, payload []byte, priv []byte) PeerMessage
func (PeerMessage) GetMessage ¶
func (m PeerMessage) GetMessage() string
func (PeerMessage) GetPayload ¶
func (m PeerMessage) GetPayload() []byte
func (PeerMessage) GetSignature ¶
func (m PeerMessage) GetSignature() [][]byte
func (PeerMessage) Serialize ¶
func (m PeerMessage) Serialize() []byte
func (*PeerMessage) SetMessage ¶
func (m *PeerMessage) SetMessage(message string)
func (*PeerMessage) SetPayload ¶
func (m *PeerMessage) SetPayload(payload []byte)
func (*PeerMessage) VerifySignature ¶
func (m *PeerMessage) VerifySignature(pub string) bool
type Worker ¶
type Worker struct { Pub []byte //public key of the node Dispatcher string // contains filtered or unexported fields }
func (Worker) Disconnect ¶
func (w Worker) Disconnect()
func (Worker) GetDispatcher ¶
func (*Worker) GetDispatchers ¶
func (w *Worker) GetDispatchers()
func (Worker) GetPrivByte ¶
func (Worker) GetPrivString ¶
func (Worker) GetPubByte ¶
func (Worker) GetPubString ¶
func (Worker) GetShortlist ¶
func (Worker) GetUptimeString ¶
func (Worker) NodeTypeDispatcher ¶
func (*Worker) SetDispatcher ¶
func (*Worker) SetShortlist ¶
func (Worker) WatchInterrupt ¶
func (w Worker) WatchInterrupt()
type WorkerInfo ¶
type WorkerInfo struct {
// contains filtered or unexported fields
}
func NewWorkerInfo ¶
func NewWorkerInfo(pub string) *WorkerInfo
func (*WorkerInfo) Assign ¶
func (w *WorkerInfo) Assign(j *qItem.Item)
func (*WorkerInfo) Busy ¶
func (w *WorkerInfo) Busy() bool
func (WorkerInfo) GetJob ¶
func (w WorkerInfo) GetJob() *qItem.Item
func (WorkerInfo) GetPub ¶
func (w WorkerInfo) GetPub() string
func (WorkerInfo) GetShut ¶
func (w WorkerInfo) GetShut() bool
func (*WorkerInfo) SetJob ¶
func (w *WorkerInfo) SetJob(j *qItem.Item)
func (*WorkerInfo) SetPub ¶
func (w *WorkerInfo) SetPub(pub string)
func (*WorkerInfo) SetShut ¶
func (w *WorkerInfo) SetShut(s bool)
type WorkerPriorityQueue ¶
type WorkerPriorityQueue struct {
// contains filtered or unexported fields
}
func NewWorkerPriorityQueue ¶
func NewWorkerPriorityQueue() *WorkerPriorityQueue
func (WorkerPriorityQueue) Len ¶
func (pq WorkerPriorityQueue) Len() int
func (WorkerPriorityQueue) Pop ¶
func (pq WorkerPriorityQueue) Pop() *melody.Session
func (WorkerPriorityQueue) Push ¶
func (pq WorkerPriorityQueue) Push(s *melody.Session, priority int)
func (WorkerPriorityQueue) Remove ¶
func (pq WorkerPriorityQueue) Remove(s *melody.Session)