barrel_embed_pool (barrel_embed v2.6.0)

View Source

One model process per model, shared by every database that uses it. A provider acquires its process by key; the pool starts it under barrel_embed_pool_sup on first use, counts references, and stops it when the last holder releases it. A process that dies is forgotten; the next acquire starts a new one.

Summary

Functions

The process for Key, started with MFA when none runs.

The Python port server for this command line, shared.

Drop one reference; the process stops with the last one. A pid the pool does not hold is ignored.

Functions

acquire(Key, MFA)

-spec acquire(term(), {module(), atom(), [term()]}) -> {ok, pid()} | {error, term()}.

The process for Key, started with MFA when none runs.

handle_call(_, From, State)

handle_cast(Msg, State)

handle_info(Info, State)

init(_)

port_server(Python, Args, Opts)

-spec port_server(string(), [string()], proplists:proplist()) -> {ok, pid()} | {error, term()}.

The Python port server for this command line, shared.

release(Pid)

-spec release(pid()) -> ok.

Drop one reference; the process stops with the last one. A pid the pool does not hold is ignored.

start_link()

-spec start_link() -> {ok, pid()} | {error, term()}.