Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a8e38d7950
|
||
|
|
2163b809b1
|
||
|
|
320bc2c313
|
@@ -1,6 +1,6 @@
|
|||||||
# einherjar/worker
|
# einherjar/worker
|
||||||
|
|
||||||
[](https://code.nochebuena.dev/einherjar/worker)
|
[](https://code.nochebuena.dev/einherjar/worker)
|
||||||
[](LICENSE)
|
[](LICENSE)
|
||||||
[](https://go.dev)
|
[](https://go.dev)
|
||||||
|
|
||||||
@@ -18,7 +18,7 @@
|
|||||||
import "code.nochebuena.dev/einherjar/worker"
|
import "code.nochebuena.dev/einherjar/worker"
|
||||||
|
|
||||||
w := worker.New(logger, worker.DefaultConfig())
|
w := worker.New(logger, worker.DefaultConfig())
|
||||||
launcher.Append(w) // OnInit starts pool; OnStop drains and stops
|
lc.Append(w) // OnInit starts pool; OnStop drains and stops
|
||||||
```
|
```
|
||||||
|
|
||||||
### Dispatching tasks
|
### Dispatching tasks
|
||||||
|
|||||||
+1
-1
@@ -6,7 +6,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
// Component adds lifecycle management to Provider.
|
// Component adds lifecycle management to Provider.
|
||||||
// Register with launcher.Register before starting.
|
// Append it to a launcher (lc.Append) before starting.
|
||||||
type Component interface {
|
type Component interface {
|
||||||
lifecycle.Component
|
lifecycle.Component
|
||||||
observability.Identifiable
|
observability.Identifiable
|
||||||
|
|||||||
@@ -9,10 +9,10 @@
|
|||||||
// ShutdownTimeout for all goroutines to finish. Returns nil regardless of
|
// ShutdownTimeout for all goroutines to finish. Returns nil regardless of
|
||||||
// whether the drain completed before the deadline.
|
// whether the drain completed before the deadline.
|
||||||
//
|
//
|
||||||
// Register with the launcher before starting:
|
// Append to a launcher before starting:
|
||||||
//
|
//
|
||||||
// pool := worker.New(logger, cfg)
|
// pool := worker.New(logger, cfg)
|
||||||
// launcher.Register(pool)
|
// lc.Append(pool)
|
||||||
//
|
//
|
||||||
// # Dispatching Tasks
|
// # Dispatching Tasks
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -2,4 +2,4 @@ module code.nochebuena.dev/einherjar/worker
|
|||||||
|
|
||||||
go 1.26
|
go 1.26
|
||||||
|
|
||||||
require code.nochebuena.dev/einherjar/contracts v1.0.0
|
require code.nochebuena.dev/einherjar/contracts v1.1.1
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
code.nochebuena.dev/einherjar/contracts v1.0.0 h1:hRudEtOIqU7vwedYLsCh8+9q5dCnKb61qX+zibqImRU=
|
code.nochebuena.dev/einherjar/contracts v1.1.1 h1:MRQUR8Q1D4wIOUIz11vpAdsapWqFTMwr0/VRvWbGO3s=
|
||||||
code.nochebuena.dev/einherjar/contracts v1.0.0/go.mod h1:ccltUtrFb5+MEJdkx2VVEUL+xC5pupVlVVsMM8AlCWI=
|
code.nochebuena.dev/einherjar/contracts v1.1.1/go.mod h1:ccltUtrFb5+MEJdkx2VVEUL+xC5pupVlVVsMM8AlCWI=
|
||||||
|
|||||||
Reference in New Issue
Block a user