Track erlang_python v3.0 simplified execution model#15
Open
benoitc wants to merge 3 commits into
Open
Conversation
- Switch dep to feature/simplify-execution-model (worker / owngil modes) - Replace obsolete num_workers config key with num_contexts - Python runners: import erlang instead of removed erlang_loop shim and skip asyncio.set_event_loop_policy on Python 3.14+
…atchers
- test/hornbeam_examples_smoke_SUITE.erl: HTTP smoke for 7 example apps.
FastAPI cases auto-skip when not installed.
- test/hornbeam_doc_python_api_SUITE.erl: every runnable snippet from
docs/reference/python-api.md as a verbatim test. 16 pass; 8
hook-related ones are skipped pending a fix to nested py:exec ->
register_hook callback synchronisation.
- scripts/docker_smoke.sh + Makefile docker-smoke: build every
Dockerfile, gating ml_caching behind DOCKER_SMOKE_HEAVY=1.
- Register dispatchers for hornbeam_callbacks (call/cast),
hornbeam_pubsub (publish), hornbeam_state (get_multi/keys), and the
hornbeam_hooks stream paths so the from-Python public API actually
reaches the corresponding Erlang modules.
- hornbeam_state:get_multi now maps missing keys to undefined to match
the documented {'user:3': None} return shape.
Switch the dep to erlang_python main.
- _is_atom helper in hornbeam_erlang.py recognises atoms whether they
arrive as erlang.Atom, bytes, or str, so execute()/await_result()
unwrap {ok, V} correctly.
- hornbeam_hooks_runner spreads *args/**kwargs into function-style hook
handlers to match the documented (action, *args, **kwargs) signature.
- hornbeam_hooks:execute_python_registered no longer double-wraps the
handler's return value.
- hornbeam_hooks:stream_ref/4 parks the Erlang generator in ETS so the
Python side has an opaque ref to pass back to stream_next_ref/1
(the previous implementation never populated the storage map).
- hornbeam.erl dispatcher exposes hooks_action stream/stream_next_ref
via the registered hornbeam_hooks Python callback.
The doc-snippet SUITE now drives hooks tests through py:call against
fixtures in test/test_apps/doc_snippets.py. The 6 hook snippets remain
skipped pending a follow-up (CT scheduler rebinding flakes the
context-router affinity), but the underlying APIs are now correct.
Full ct: 193 passed, 10 skipped, 0 failed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
erlang_pythondep tomain(v3.0 simplified execution model: worker / owngil)config/sys.config: replace obsoletenum_workerswithnum_contextsasgi,lifespan,websocket): importerlanginstead of the removederlang_loopshim, skipasyncio.set_event_loop_policyon Python 3.14+test/hornbeam_examples_smoke_SUITE.erl— HTTP smoke for 7 example appstest/hornbeam_doc_python_api_SUITE.erl— every runnable snippet fromdocs/reference/python-api.mdas a verbatim test (16 pass, 8 hook-related skipped, 1 import-surface check)scripts/docker_smoke.sh+make docker-smoke— build every Dockerfile (5 of them; ml_caching gated onDOCKER_SMOKE_HEAVY=1)hornbeam_callbacksregistered sofrom hornbeam_erlang import call/castactually workshornbeam_pubsubregistered sopublish(topic, msg)reacheshornbeam_pubsub:publish/2hornbeam_stateregistered forstate_get_multi/state_keyshornbeam_hooksextended withstream/stream_next_refactionshornbeam_state:get_multinow returnsundefinedfor missing keys (matches doc)Verification
rebar3 ct— full suite: 193 passed, 10 skipped, 0 failedpy:exec+register_hook. Tracked for follow-up rather than weakening the snippet.fastapiisn't installed.