Closed rawkode closed 7 years ago
Hi,
I could resurrect the code I used before, that would let the user start the app before the user's, and pass a custom configuration.
Your problem, if I understand correctly, is that you want to configure bolt_sips using :wave? Didn't hear about :wave till now, sorry. I'll try to find the time and look into this, unless you already have a PR? :)
Florin
I think I have a version working. I'll PR it when I've done more testing :+1:
Awesome! Thank you!!
OK, I thought I had this; but unfortunately I don't. Help appreciated :+1:
Hi David - can you please check v0.3.1? Now, you can do something like this:
def application do
# Specify extra applications you'll use from Erlang/Elixir
[ extra_applications: [:logger], mod:
{Bolt.Sips.Application, [url: 'localhost', pool_size: 15]}
]
end
Please let me know if this version can be used with weave.
HTH
Hi @florinpatrascu, nothing above 2.4.6 seems published to hex?
Sorry, I see; it's a branch. I'll give it a try :+1:
Hi @florinpatrascu,
OK; I've found the problem.
Firstly, I need to stop :bolt_sips
starting automatically, as it needs configured before launch.
For this, I added app: :false
to the deps and that seems great.
I then add worker(Bolt.Sips, [Application.get_env(:bolt_sips, Bolt)])
to my application supervisor and things begin to break.
It turns out, once my app adds the worker and calls start_link
on Bolt.Sips
, the following call blocks indefinitely:
ConCache.start_link([], name: :bolt_sips_cache)
Removing ConCache
altogether gets it working for me.
From what I can tell, this is a micro-optimisation anyway, with no real value. Perhaps we could remove it? Or is there something I'm missing?
David, np - can you please give me an example of how you would like to use :bolt_sips, with :weave? I am sure I am too missing something. This branch, 0.3.1 respectively, is allowing you to start Bolt.Sips from your app and also to specify configuration variables that will override your config/${MIX_ENV}.exs
files. In this branch, :bolt_sips will not start automatically anymore. I thought that's what you wanted?!
also, you said before:
Firstly, I need to stop :bolt_sips starting automatically, as it needs configured before launch.
this is what 0.3.1 does, to start with
and if you don't mind, how can I replicate this:
[...] the following call blocks indefinitely:
ConCache.start_link([], name: :bolt_sips_cache)
many thanks, for your patience!
You're right, 0.3.1
does fix this; awesome!
I know that environment variables can be injected too, but for delivering secrets, it's best to use other means: which is what I am using :weave
for.
I'll put together a small application that demos my issue.
Thanks for your help
niceee!!! Glad it helps!!! 🍻
0.3.1 works as needed. Thanks :+1:
Awesome. Tonight, I'll publish the new version on hex.pm Thank you, for your feedback!
Package published to https://hex.pm/packages/bolt_sips/0.3.1
Hi,
You specify:
This makes it impossible to provide configuration at runtime, using
:weave
.I've tried adding
runtime: false
to stop BoltSips automatically starting up and instead manually starting it in my application module callback, withbut this causes everything to "hang"