Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CallbackSender ¶
type CallbackSender interface {
SendCallback(appID string, payload webhook.WebhookPayload) error
}
type CallbackTask ¶
type CallbackTask struct { AppID string `json:"app_id"` WebhookPayload webhook.WebhookPayload `json:"webhook"` }
CallbackTask is the task to be queued.
func (*CallbackTask) Send ¶
func (ct *CallbackTask) Send(s CallbackSender) error
Send executes the send operation, so a webhook is sent to the configured callback url.
type CallbackWorker ¶
type CallbackWorker struct {
// contains filtered or unexported fields
}
Worker represents a single worker
func NewCallbackWorker ¶
func NewCallbackWorker(id int, queue QueueManager, logger log.Logger, callbackSender CallbackSender) CallbackWorker
NewCallbackWorker creates a new worker
func (CallbackWorker) Start ¶
func (w CallbackWorker) Start(wg *sync.WaitGroup)
Start begins the worker's task processing loop
type CallbackWorkerPool ¶
type CallbackWorkerPool struct {
// contains filtered or unexported fields
}
CallbackWorkerPool manages the task queue and worker pool
func NewCallbackWorkerPool ¶
func NewCallbackWorkerPool(queue QueueManager, logger log.Logger, callbackSender CallbackSender, numWorkers int) *CallbackWorkerPool
NewCallbackWorkerPool creates a new worker pool
func (*CallbackWorkerPool) Send ¶
func (wp *CallbackWorkerPool) Send(qm CallbackTask) error
Send adds a task to the task queue
func (*CallbackWorkerPool) Start ¶
func (wp *CallbackWorkerPool) Start()
Start initializes and starts the workers
func (*CallbackWorkerPool) Stop ¶
func (wp *CallbackWorkerPool) Stop()
Stop signals all workers to stop
Click to show internal directories.
Click to hide internal directories.