Skip to content

feat(taskworker): Add Push Mode to Taskworker#576

Open
james-mcnulty wants to merge 5 commits intomainfrom
george/push-taskbroker/add-push-mode-to-taskworker
Open

feat(taskworker): Add Push Mode to Taskworker#576
james-mcnulty wants to merge 5 commits intomainfrom
george/push-taskbroker/add-push-mode-to-taskworker

Conversation

@james-mcnulty
Copy link
Member

Linear

Completes STREAM-822

Description

Currently, taskworkers pull tasks from taskbrokers via RPC. This approach works, but has some drawbacks. Therefore, we want taskbrokers to push tasks to taskworkers instead. Read this page on Notion for more information.

This PR allows users to run the taskworker in push mode via the --push-mode and --grpc-port CLI options.

Option Type Default Description
--push-mode bool False Whether to run in push or pull mode.
--grpc-port int 50052 The port to use for the taskworker gRPC server.

Details

Dependencies

  • Upgrade sentry-protos from 0.4.11 to 0.8.5 (to use the new worker service schema)

Additions

  • Define WorkerServicer class in worker.py
  • Add push_mode and grpc_port fields to TaskWorker and TaskbrokerClient classes
  • Add push_task method to TaskWorker class
  • Add gauge method to metrics backend abstract class
  • Add unit tests for push mode

Modifications

  • Start gRPC server if push mode, enter pull loop if pull mode
  • Add _get_stub method to TaskbrokerClient to connect to brokers on the fly by using the activation callback URL

@james-mcnulty james-mcnulty requested a review from a team as a code owner March 19, 2026 00:20
@linear-code
Copy link

linear-code bot commented Mar 19, 2026

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

There are 2 total unresolved issues (including 1 from previous review).

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant