Skip to content

Commit 5e676f2

Browse files
committed
Fix three stale doc snippets
py_event_loop:get_loop/0 already returns a NIF reference; the docs in event_loop_architecture.md and process-bound-envs.md were unwrapping it through a non-existent get_nif_ref/1. Drop the wrapper. pools.md showed a {default_pool_size, _} sys.config key; the supervisor reads num_contexts. Use the real key.
1 parent 2075f2d commit 5e676f2

3 files changed

Lines changed: 6 additions & 7 deletions

File tree

docs/event_loop_architecture.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,8 +253,7 @@ Define functions and state for async tasks in your process's namespace:
253253
254254
```erlang
255255
%% Get event loop reference
256-
{ok, Loop} = py_event_loop:get_loop(),
257-
LoopRef = py_event_loop:get_nif_ref(Loop),
256+
{ok, LoopRef} = py_event_loop:get_loop(),
258257
259258
%% Define async functions in this process's namespace
260259
ok = py_nif:event_loop_exec(LoopRef, <<"

docs/pools.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,14 +165,15 @@ default = py_context_router:lookup_pool(json, dumps). %% Function override
165165

166166
## Configuration
167167

168-
Configure default pool size via application environment:
168+
Configure the default pool size via the application environment:
169169

170170
```erlang
171171
%% sys.config
172172
[
173173
{erlang_python, [
174-
%% Default pool size (default: erlang:system_info(schedulers))
175-
{default_pool_size, 8}
174+
%% Number of contexts in the default pool
175+
%% (default: erlang:system_info(schedulers))
176+
{num_contexts, 8}
176177
]}
177178
].
178179
```

docs/process-bound-envs.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,7 @@ The event loop API also supports per-process namespaces. Each Erlang process get
125125

126126
```erlang
127127
%% Get the event loop reference
128-
{ok, Loop} = py_event_loop:get_loop(),
129-
LoopRef = py_event_loop:get_nif_ref(Loop),
128+
{ok, LoopRef} = py_event_loop:get_loop(),
130129

131130
%% Define a function in this process's namespace
132131
ok = py_nif:event_loop_exec(LoopRef, <<"

0 commit comments

Comments
 (0)