Documentation ¶
Overview ¶
Dispatch operations:
- Basic dequeue
- Connection sends POP q1, q2
- Job moved from Queue into Working
- Scheduled
- Job Pushed into Queue
- Job moved from Queue into Working
- Failure
- Job Pushed into Retries
- Push
- Job Pushed into Queue
- Ack
- Job removed from Working
How are jobs passed to waiting workers?
Socket sends "POP q1, q2, q3" Connection pops each queue:
store.GetQueue("q1").Pop()
and returns if it gets any non-nil data.
If all nil, the connection registers itself, blocking for a job.
Index ¶
- Variables
- func CurrentState(s *Server) (map[string]interface{}, error)
- func OnStart(x func(*Server) error)
- type ClientWorker
- type Connection
- type FailPayload
- type Reservation
- type RuntimeStats
- type Server
- func (s *Server) Fail(jid, msg, errtype string, backtrace []string) error
- func (s *Server) Fetch(fn func(*faktory.Job) error, ctx context.Context, queues ...string) (*faktory.Job, error)
- func (s *Server) Heartbeats() map[string]*ClientWorker
- func (s *Server) Start() error
- func (s *Server) Stop(f func())
- func (s *Server) Store() storage.Store
- type ServerOptions
- type TimedSet
Constants ¶
This section is empty.
Variables ¶
View Source
var (
DefaultTimeout = 1800
)
View Source
var (
EventHandlers = make([]func(*Server) error, 0)
)
Functions ¶
func CurrentState ¶
Types ¶
type ClientWorker ¶
type ClientWorker struct { Hostname string `json:"hostname"` Wid string `json:"wid"` Pid int `json:"pid"` Labels []string `json:"labels"` Salt string `json:"salt"` PasswordHash string `json:"pwdhash"` StartedAt time.Time // contains filtered or unexported fields }
func (*ClientWorker) BusyCount ¶
func (worker *ClientWorker) BusyCount() int
func (*ClientWorker) IsQuiet ¶
func (worker *ClientWorker) IsQuiet() bool
func (*ClientWorker) Signal ¶
func (worker *ClientWorker) Signal(sig string)
* Send "quiet" or "terminate" to the given client * worker process. Other signals are undefined.
type Connection ¶
type Connection struct {
// contains filtered or unexported fields
}
* Represents a connection to a faktory client. * * faktory reuses the same wire protocol as Redis: RESP. * It's a nice trade-off between human-readable and efficient. * Shout out to antirez for his nice design document on it. * * https://redis.io/topics/protocol
func (*Connection) Close ¶
func (c *Connection) Close()
func (*Connection) Identity ¶
func (c *Connection) Identity() string
func (*Connection) Number ¶
func (c *Connection) Number(val int) error
func (*Connection) Ok ¶
func (c *Connection) Ok() error
func (*Connection) Result ¶
func (c *Connection) Result(msg []byte) error
type FailPayload ¶
type Reservation ¶
type RuntimeStats ¶
type Server ¶
type Server struct { Options *ServerOptions Stats *RuntimeStats TLSConfig *tls.Config Password string // contains filtered or unexported fields }
func NewServer ¶
func NewServer(opts *ServerOptions) (*Server, error)
func (*Server) Heartbeats ¶
func (s *Server) Heartbeats() map[string]*ClientWorker
type ServerOptions ¶
Click to show internal directories.
Click to hide internal directories.