std

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2021 License: BSD-3-Clause Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddHandler

func AddHandler(job interface{}, fn interface{})

func GetHandler

func GetHandler(name string) (interface{}, bool)

func GetPayloadName

func GetPayloadName(payload interface{}) string

func InvokeHandler

func InvokeHandler(payload interface{}) (e error)

func MarshalPayload

func MarshalPayload(payload interface{}) ([]byte, error)

Types

type Job

type Job struct {
	PayloadType string
	Payload     []byte
}

func ToJob

func ToJob(payload interface{}) (j Job, e error)

func (Job) Invoke

func (j Job) Invoke() (e error)

type JobHandler

type JobHandler struct {
}

func (JobHandler) HandleMessage

func (JobHandler) HandleMessage(m *nsq.Message) error

type Worker

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

func NewWorker

func NewWorker(concurrency int, connection contracts.Connection) *Worker

func (*Worker) Close

func (w *Worker) Close() error

func (*Worker) Run

func (w *Worker) Run(done chan struct{}) error

Jump to

Keyboard shortcuts

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