Documentation ¶
Index ¶
- Variables
- type Client
- func (c *Client) Cancel(id string) error
- func (c *Client) Close() error
- func (c *Client) InspectN(n int, jobs *[]*Job) error
- func (c *Client) Next(timeout time.Duration) (string, []byte, error)
- func (c *Client) Ping() error
- func (c *Client) Put(body []byte, delay time.Duration) (string, error)
- func (c *Client) PutWithID(id string, body []byte, delay time.Duration) error
- type Job
Constants ¶
This section is empty.
Variables ¶
var ErrClientDisconnected = errors.New("Client is not connected to the server")
ErrClientDisconnected means a client was used while it was disconnected from the remote server
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client communicates with the Chronomq RPC server
func NewClient ¶
NewClient creates an rpc client and tries to connect to a Chronomq RCP Server. Returns a connected client Once connected, a client may be used by multiple goroutines simultaneously.
func (*Client) Cancel ¶
Cancel deletes a job identified by the given id. Calls to cancel are idempotent
func (*Client) InspectN ¶
InspectN fetches upto n number of jobs from the server without consuming them
func (*Client) Next ¶
Next wait at-most timeout duration to return a ready job body from Chronomq If no job is available within the timeout, ErrTimeout is returned and clients should try again later