Using decorators instead of classes to create tasks
Changes
- Added ability to create task using decorator: `worker.task()`
- Added class called `ZeebeTaskRouter` which should help organize projects
- Renamed `TaskContext` to `Job`
- Merged `TaskStatusController` functionality into the new `Job` class
- Removed `Task` from standard imports because of decorator
API Changes
External updates:
- Renamed `TaskContext` to `Job`
- Merged `TaskStatusController` functionality into the new `Job` class
- Renamed `TaskStatus` to `JobStatus`
- Moved `stop_event` from `work` internally, so users don't have to import `threading.Event`
- Added `stop` function to `ZeebeWorker` which now uses the internal `threading.Event`
- Renamed `add_task` to `_add_task`
- Added class `ZeebeTaskRouter` which inherits from `ZeebeTaskHandler`. This class allows splitting tasks into multiple files (like fastapi's `APIRouter`)
- Added `include_router` to `ZeebeWorker` which allows a `ZeebeWorker` instance to absorb a `ZeebeTaskRouter`'s tasks
- Added `ExceptionHandler` for ease of use
- Added optional `message_id` parameter to `publish_message` in `ZeebeClient`