Categorygithub.com/enorith/queue
modulepackage
0.0.9
Repository: https://github.com/enorith/queue.git
Documentation: pkg.go.dev

# README

Queue component of Enorith

Usage

Register connection

queue.DefaultManager.RegisterConnection("nsq", func() (contracts.Connection, error) {
    return connections.NewNsqFromConfig(connections.NsqConfig{
        Nsqd: "127.0.0.1:4150",
    }), nil
})

Register worker

c, _ := queue.DefaultManager.GetConnection("nsq")
queue.DefaultManager.RegisterWorker("nsq", std.NewWorker(4, c))

Run worker

done := make(chan struct{}, 1)
queue.DefaultManager.Work(done, "nsq")

exit := make(chan os.Signal, 1)
signal.Notify(exit, os.Interrupt, syscall.SIGTERM, syscall.SIGINT)
<-exit
done <- struct{}{}

# Packages

No description provided by the author
No description provided by the author
No description provided by the author

# Functions

No description provided by the author

# Variables

No description provided by the author
No description provided by the author

# Structs

No description provided by the author
No description provided by the author
No description provided by the author

# Type aliases

No description provided by the author