Thanks! I’ve just tried it out, but end up with an error during application startup:
Consolidated IEx.Info
Consolidated Inspect
[info] Running Wolf.Endpoint with Cowboy using http on port 4000
[error] ** :sbroker_meter :sregulator_underload_meter failed to install.
** Was installing in {DBConnection.Sojourn.Regulator, #PID<0.4147.0>}
** When arguments == {500, 5000, {:underload, Wolf.Repo.Pool}}
** Reason == {:badarg,
[{:gen_event, :send, 2, [file: 'gen_event.erl', line: 232]},
{:sregulator_underload_meter, :init, 2,
[file: 'src/sregulator_underload_meter.erl', line: 68]},
{:sbroker_handlers, :meters_init, 5,
[file: 'src/sbroker_handlers.erl', line: 248]},
{:sbroker_handlers, :meters_init, 4,
[file: 'src/sbroker_handlers.erl', line: 238]},
{:sregulator, :do_init, 6, [file: 'src/sregulator.erl', line: 639]},
{:proc_lib, :init_p_do_apply, 3, [file: 'proc_lib.erl', line: 240]}]}
[info] Application wolf exited: Wolf.start(:normal, []) returned an error: shutdown: failed to start child: Wolf.Repo
** (EXIT) shutdown: failed to start child: :sbroker
** (EXIT) an exception was raised:
** (MatchError) no match of right hand side value: {:error, {:shutdown, {:failed_to_start_child, :regulator, {:badarg, [{:gen_event, :send, 2, [file: 'gen_event.erl', line: 232]}, {:sregulator_underload_meter, :init, 2, [file: 'src/sregulator_underload_meter.erl', line: 68]}, {:sbroker_handlers, :meters_init, 5, [file: 'src/sbroker_handlers.erl', line: 248]}, {:sbroker_handlers, :meters_init, 4, [file: 'src/sbroker_handlers.erl', line: 238]}, {:sregulator, :do_init, 6, [file: 'src/sregulator.erl', line: 639]}, {:proc_lib, :init_p_do_apply, 3, [file: 'proc_lib.erl', line: 240]}]}}}}
(db_connection) lib/db_connection/sojourn/broker.ex:92: DBConnection.Sojourn.Broker.start_pool/2
(db_connection) lib/db_connection/sojourn/broker.ex:74: DBConnection.Sojourn.Broker.init/1
src/sbroker.erl:632: :sbroker.init_it/6
(stdlib) proc_lib.erl:240: :proc_lib.init_p_do_apply/3
[info] Application eldap exited: :stopped
[info] Application comeonin exited: :stopped
[info] Application postgrex exited: :stopped
[info] Application db_connection exited: :stopped
[info] Application connection exited: :stopped
[info] Application phoenix_ecto exited: :stopped
[info] Application ecto exited: :stopped
[info] Application poolboy exited: :stopped
[info] Application decimal exited: :stopped
[info] Application gettext exited: :stopped
[info] Application cowboy exited: :stopped
[info] Application cowlib exited: :stopped
[info] Application ranch exited: :stopped
[info] Application phoenix_html exited: :stopped
=INFO REPORT==== 11-Jun-2016::21:37:00 ===
application: logger
exited: stopped
type: temporary
** (Mix) Could not start application wolf: Wolf.start(:normal, []) returned an error: shutdown: failed to start child: Wolf.Repo
** (EXIT) shutdown: failed to start child: :sbroker
** (EXIT) an exception was raised:
** (MatchError) no match of right hand side value: {:error, {:shutdown, {:failed_to_start_child, :regulator, {:badarg, [{:gen_event, :send, 2, [file: 'gen_event.erl', line: 232]}, {:sregulator_underload_meter, :init, 2, [file: 'src/sregulator_underload_meter.erl', line: 68]}, {:sbroker_handlers, :meters_init, 5, [file: 'src/sbroker_handlers.erl', line: 248]}, {:sbroker_handlers, :meters_init, 4, [file: 'src/sbroker_handlers.erl', line: 238]}, {:sregulator, :do_init, 6, [file: 'src/sregulator.erl', line: 639]}, {:proc_lib, :init_p_do_apply, 3, [file: 'proc_lib.erl', line: 240]}]}}}}
(db_connection) lib/db_connection/sojourn/broker.ex:92: DBConnection.Sojourn.Broker.start_pool/2
(db_connection) lib/db_connection/sojourn/broker.ex:74: DBConnection.Sojourn.Broker.init/1
src/sbroker.erl:632: :sbroker.init_it/6
(stdlib) proc_lib.erl:240: :proc_lib.init_p_do_apply/3
My changes were basically:
diff --git a/config/dev.exs b/config/dev.exs
index a35dc43..5081046 100644
--- a/config/dev.exs
+++ b/config/dev.exs
@@ -39,4 +39,5 @@ config :wolf, Wolf.Repo,
password: "REDACTED",
database: "wolf_dev",
hostname: "localhost",
+ pool: DBConnection.Sojourn,
pool_size: 10
diff --git a/mix.exs b/mix.exs
index 5dc5327..09efcbc 100644
--- a/mix.exs
+++ b/mix.exs
@@ -42,7 +42,7 @@ defmodule Wolf.Mixfile do
# Type `mix help deps` for examples and options.
defp deps do
[{:phoenix, "~> 1.1.4"},
- {:postgrex, ">= 0.11.1"},
+ #{:postgrex, ">= 0.11.1"},
{:phoenix_ecto, "~> 3.0.0-rc"},
{:phoenix_html, "~> 2.4"},
{:phoenix_live_reload, "~> 1.0", only: :dev},
@@ -50,6 +50,12 @@ defmodule Wolf.Mixfile do
{:cowboy, "~> 1.0"},
{:comeonin, "~> 2.0"},
{:exrm, "~> 1.0"},
+ # lazy pooling
+ {:ecto, github: "fishcakez/ecto", branch: "jf-db_conn_1_0", override: true},
+ {:db_connection, github: "fishcakez/db_connection", override: true},
+ {:postgrex, github: "fishcakez/postgrex", branch: "jf-db_conn-1_0", override: true},
+ {:sbroker, github: "fishcakez/sbroker", tag: "v1.0.0-beta.1", override: true},
+ # test / dev
{:wallaby, "~> 0.4", only: :test},
{:excoveralls, "~> 0.4", only: :test},
{:credo, "~> 0.3", only: [:dev, :test]},
Haven’t had time to dig deeper (on vacation right now)… Not at all unlikely that I’m using older versions of something else that’s causing expectations to mismatch.