Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hnc-agency/hnc
hnc - Erlang worker pool
https://github.com/hnc-agency/hnc
erlang pool
Last synced: about 17 hours ago
JSON representation
hnc - Erlang worker pool
- Host: GitHub
- URL: https://github.com/hnc-agency/hnc
- Owner: hnc-agency
- License: isc
- Created: 2020-02-10T04:13:18.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2022-12-28T09:30:50.000Z (almost 2 years ago)
- Last Synced: 2024-08-06T16:46:19.959Z (3 months ago)
- Topics: erlang, pool
- Language: Erlang
- Homepage:
- Size: 133 KB
- Stars: 8
- Watchers: 4
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# hnc (Agency) - Erlang worker pool
```erlang
%% Start hnc application.
application:ensure_all_started(hnc).%% Start a pool with default options.
{ok, _}=hnc:start_pool(my_pool, #{}, my_worker, []).%% Check out a worker.
WorkerRef=hnc:checkout(my_pool).%% Get the worker pid from the identifier.
Worker=hnc:get_worker(WorkerRef).%% Do some stuff with the worker.
my_worker:do_stuff(Worker).%% Check worker back in.
ok=hnc:checkin(my_pool, WorkerRef).%% Stop the pool
ok=hnc:stop_pool(my_pool).
```