Documentation ¶
Index ¶
- Constants
- Variables
- type Client
- func (c *Client) Ack(jid string) error
- func (c *Client) Beat() (string, error)
- func (c *Client) Close() error
- func (c *Client) Fail(jid string, err error, backtrace []byte) error
- func (c *Client) Fetch(q ...string) (*Job, error)
- func (c *Client) Flush() error
- func (c *Client) Generic(cmdline string) (string, error)
- func (c *Client) Info() (map[string]interface{}, error)
- func (c *Client) Push(job *Job) error
- type ClientData
- type Failure
- type Job
- type ProtocolError
- type Server
Constants ¶
View Source
const ( // This is the protocol version supported by this client. // The server might be running an older or newer version. ExpectedProtocolVersion = 2 )
Variables ¶
View Source
var ( Name = "Faktory" License = "GPLv3" Licensing = "Licensed under the GNU Public License 3.0" Version = "0.6.0" )
View Source
var (
// Set this to a non-empty value in a consumer process
RandomProcessWid = ""
)
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { Location string Options *ClientData // contains filtered or unexported fields }
func Dial ¶
Dial connects to the remote faktory server.
faktory.Dial(faktory.Localhost, "topsecret")
func Open ¶
Open connects to a Faktory server based on the environment variable conventions:
• Use FAKTORY_PROVIDER to point to a custom URL variable.
• Use FAKTORY_URL as a catch-all default.
type ClientData ¶
type ClientData struct { Hostname string `json:"hostname"` Wid string `json:"wid"` Pid int `json:"pid"` Labels []string `json:"labels"` // Hash is hex(sha256(password + nonce)) PasswordHash string `json:"pwdhash"` // The protocol version used by this client. // The server can reject this connection if the version will not work // The server advertises its protocol version in the HI. Version int `json:"v"` }
ClientData is serialized to JSON and sent with the HELLO command. PasswordHash is required if the server is not listening on localhost. The WID (worker id) must be random and unique for each worker process. It can be a UUID, etc. Non-worker processes should leave WID empty.
The other elements can be useful for debugging and are displayed on the Busy tab.
type Job ¶
type Job struct { // required Jid string `json:"jid"` Queue string `json:"queue"` Type string `json:"jobtype"` Args []interface{} `json:"args"` // optional Priority uint8 `json:"priority,omitempty"` CreatedAt string `json:"created_at,omitempty"` EnqueuedAt string `json:"enqueued_at,omitempty"` At string `json:"at,omitempty"` ReserveFor int `json:"reserve_for,omitempty"` Retry int `json:"retry,omitempty"` Backtrace int `json:"backtrace,omitempty"` Failure *Failure `json:"failure,omitempty"` Custom map[string]interface{} `json:"custom,omitempty"` }
func (*Job) EnsureValidPriority ¶
func (j *Job) EnsureValidPriority()
func (*Job) GetPriority ¶
Accessor so that if priority isn't specified we don't persist it to disk
type ProtocolError ¶
type ProtocolError struct {
// contains filtered or unexported fields
}
func (*ProtocolError) Error ¶
func (pe *ProtocolError) Error() string
Directories ¶
Path | Synopsis |
---|---|
cmd
|
|
brodal
adapted from https://github.com/cngkaygusuz/BrodalOkasakiHeap The MIT License (MIT) Copyright (c) 2015 ckaygusu Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
adapted from https://github.com/cngkaygusuz/BrodalOkasakiHeap The MIT License (MIT) Copyright (c) 2015 ckaygusu Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. |
test
|
|
Click to show internal directories.
Click to hide internal directories.