Skip to content
This repository has been archived by the owner on Feb 24, 2024. It is now read-only.

refine/improve the design of worker and simple worker implementation #2242

Open
1 task done
sio4 opened this issue Apr 18, 2022 · 1 comment
Open
1 task done

refine/improve the design of worker and simple worker implementation #2242

sio4 opened this issue Apr 18, 2022 · 1 comment
Assignees
Labels
breaking change This feature / fix introduces breaking changes enhancement New feature or request
Milestone

Comments

@sio4
Copy link
Member

sio4 commented Apr 18, 2022

The current design and implementation of Worker and Simple worker are somewhat ambiguous and they need to be redefined. The points of consideration could be:

  • Definition of Worker and its components including functions
  • How to make them more reliable (when starting, stopping, and while running)
  • Workflow (both automatic parts and manual parts)

TODO

  • How to check if the worker is ready to work
    • When the worker should be initialized?
    • How to check if the worker is ready?
    • and purpose of the context
  • Define the purpose of Start(context) clearly
  • Consider timeout and/or cancellation for background jobs
  • Consider if the already-submitted jobs to be performed even if the worker canceled before they are executed

Context

See Also

@acaloiaro
Copy link
Contributor

acaloiaro commented Feb 23, 2023

@sio4 I've been working on something that might be relevant to this issue: https://github.com/acaloiaro/neoq

It's still immature, but progressing nicely. With its current MemBackend and PgBackend implementations, I can see it being a reasonable replacement for SimpleWorker and gocraft/work. More out-of-the-box backends will be in the works for data stores like Redis, SQS, RabbitMQ, etc.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
breaking change This feature / fix introduces breaking changes enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants