Skip to content
This repository has been archived by the owner on May 31, 2022. It is now read-only.

Worker interface #2

Open
mingard opened this issue Feb 23, 2021 · 0 comments
Open

Worker interface #2

mingard opened this issue Feb 23, 2021 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@mingard
Copy link
Contributor

mingard commented Feb 23, 2021

type Worker interface {
  // Start the worker with the given context
  GetID() string
  // Start the worker with the given context
  Start(context.Context) error
  // Stop the worker
  Stop() error
  // AddJob to the workers queue
  AddJob(interface{}) error
  // ScheduleJob
  ScheduleJob(interface{}, time.Time) error
  // JobHandler
  JobHandler(func(interface{})) error
  // OnClose
  OnClose(func())
  // SetMetadata sets arbitrary metadata values
  SetMetadata(interface{})
  // GetMetadata gets metadata
  GetMetadata(interface{})
}
@mingard mingard added the enhancement New feature or request label Feb 23, 2021
@mingard mingard self-assigned this Feb 23, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant