1 |
|
-module(mongoose_wpool_elastic). |
2 |
|
-behaviour(mongoose_wpool). |
3 |
|
|
4 |
|
-export([init/0]). |
5 |
|
-export([start/4]). |
6 |
|
-export([stop/2]). |
7 |
|
|
8 |
|
%% -------------------------------------------------------------- |
9 |
|
%% mongoose_wpool callbacks |
10 |
|
-spec init() -> ok. |
11 |
|
init() -> |
12 |
7 |
tirerl:start(), |
13 |
7 |
ok. |
14 |
|
|
15 |
|
-spec start(mongooseim:host_type_or_global(), mongoose_wpool:tag(), |
16 |
|
mongoose_wpool:pool_opts(), mongoose_wpool:conn_opts()) -> {ok, pid()} | {error, any()}. |
17 |
|
start(HostType, Tag, WpoolOptsIn, ConnOpts) -> |
18 |
7 |
ProcName = mongoose_wpool:make_pool_name(elastic, HostType, Tag), |
19 |
7 |
WPoolOptions = [{overrun_warning, infinity}, |
20 |
|
{overrun_handler, {error_logger, warning_report}}, |
21 |
|
{worker, {tirerl_worker, maps:to_list(ConnOpts)}} |
22 |
|
| WpoolOptsIn], |
23 |
7 |
mongoose_wpool:start_sup_pool(elastic, ProcName, WPoolOptions). |
24 |
|
|
25 |
|
-spec stop(mongooseim:host_type_or_global(), mongoose_wpool:tag()) -> ok. |
26 |
|
stop(_, _) -> |
27 |
2 |
ok. |