Skip to content

Remove the legacy worker API and its executor - #75

Merged
benoitc merged 1 commit into
mainfrom
remove-legacy-paths
Aug 29, 2026
Merged

Remove the legacy worker API and its executor#75
benoitc merged 1 commit into
mainfrom
remove-legacy-paths

Conversation

@benoitc

@benoitc benoitc commented Aug 29, 2026

Copy link
Copy Markdown
Owner

Removes the code that no context created today can reach, so what is left is what runs.

Before contexts, Python ran on a single executor thread driven by per-worker NIFs (worker_new, worker_call, resume_callback, ...). Contexts replaced that, but the old path stayed: the executor was still started at init, erlang.call still checked for a worker handler, the context NIFs kept an inline "legacy mode" branch, and a second worker pool with no caller was compiled in. A reader tracing a call had four candidate paths and no way to tell which one was live.

This removes the worker API and its executor, the async worker NIFs that only returned deprecated, the worker pool, the cancel_reader/writer aliases and the inline branches, with their Erlang stubs and types. py:memory_stats/0 and py:gc/0,1, which ran on the executor, now take the GIL on the calling scheduler. The generator example moves to py:stream. The architecture and code map pages no longer list legacy paths.

About 3,000 lines fewer, no behaviour change for contexts. The removed NIFs were public, so the open release is 5.0.0. Full suite green on macOS and FreeBSD apart from two pre-existing local failures that reproduce on main.

Contexts are the only execution path; the per-worker NIFs, the single
executor thread they ran on, the deprecated async worker NIFs, the unused
worker pool, the cancel aliases and the unreachable inline executor
branches of the context NIFs are gone (about 3,000 lines). This removes
public NIF functions, so the open release becomes 5.0.0. memory_stats and
gc run under the GIL on the calling scheduler. The generator example uses
py:stream.
@benoitc
benoitc merged commit 50a7610 into main Aug 29, 2026
20 checks passed
@benoitc
benoitc deleted the remove-legacy-paths branch August 29, 2026 13:37
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