Skip to content

Remove the deprecated TaskBroker.enqueue() - #56

Merged
tokibito merged 1 commit into
mainfrom
remove-broker-enqueue
Sep 30, 2026
Merged

tokibito merged 1 commit into
mainfrom
remove-broker-enqueue

Conversation

@tokibito

Copy link
Copy Markdown
Owner

TaskBroker.enqueue() was renamed to notify() in 0.5. A broker that still overrode enqueue() kept being called, with a DeprecationWarning saying it would be ignored in 0.6, and the CHANGELOG's Deprecated entry for 0.5 announced the same. This removes the alias from TaskBroker and the backend's fallback to the override before 0.6 is released, as get_auth_handler() was removed in 0.5.

A broker that overrides only enqueue() is no longer called: the backend calls notify(), which raises NotImplementedError on TaskBroker, and logs Broker X failed to notify about task Y at ERROR, as for any broker failure. The task is saved as before, so run_database_tasks and the HTTP endpoints still pick it up. Code that called broker.enqueue() by hand gets an AttributeError. Bundled brokers, the BROKER option and brokers already on notify() are unaffected.

The tests for the deprecation path in tests/test_brokers.py are replaced by tests for the removal: an enqueue() override is not called, the failure is logged, the task stays READY and no warning is emitted. The CHANGELOG has an entry under Removed, and CONTRIBUTING's example of a deprecation now speaks of it in the past tense.

TaskBroker.enqueue() was renamed to notify() in 0.5, and a broker that
still overrode it was called with a DeprecationWarning saying it would be
ignored in 0.6. This removes the alias and the backend's fallback to the
override, as announced.

A broker that overrides only enqueue() now fails in notify() like any
other broker failure: the error is logged and the task stays in the
database for the worker and the HTTP endpoints. Bundled brokers and the
BROKER option are unaffected.
@tokibito
tokibito merged commit c26c700 into main Sep 30, 2026
10 checks passed
@tokibito
tokibito deleted the remove-broker-enqueue branch September 30, 2026 16:00
@tokibito tokibito mentioned this pull request Sep 30, 2026
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