protocol

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrTimeout = errors.New("No new jobs available in given timeout")

ErrTimeout indicates that no new jobs were ready to be consumed within the given timeout duration

Functions

func ServeRPC added in v1.3.0

func ServeRPC(hub *chronomq.Hub, addr string) (io.Closer, error)

ServeRPC starts serving hub over rpc

Types

type RPCServer added in v1.3.0

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

RPCServer exposes a Chronomq hub backed RPC endpoint

func (*RPCServer) Cancel added in v1.3.0

func (r *RPCServer) Cancel(id string, ignoredReply *int8) error

Cancel deletes the job pointed to by the id, reply is ignored If the job doesn't exist, no error is returned so calls to Cancel are idempotent

func (*RPCServer) InspectN added in v1.3.0

func (r *RPCServer) InspectN(n int, rpcJobs *[]*api.Job) error

InspectN returns n jobs without removing them for ad-hoc inspection

func (*RPCServer) Next added in v1.3.0

func (r *RPCServer) Next(timeout time.Duration, job *api.Job) error

Next sets the reply (job) to a valid job if a job is ready to be triggered If not job is ready yet, this call will wait (block) for the given duration and keep searching for ready jobs. If no job is ready by the end of the timeout, ErrTimeout is returned

func (*RPCServer) Ping added in v1.3.0

func (r *RPCServer) Ping(ignore int8, pong *string) error

Ping the server, sets "pong" as the reply useful for basic connectivity/liveness check

func (*RPCServer) PutWithID added in v1.3.0

func (r *RPCServer) PutWithID(rpcJob api.Job, id *string) error

PutWithID accepts a new job and stores it in a Hub, reply is ignored

Jump to

Keyboard shortcuts

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