Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce start_link/1 callback to support runtime configuration #20

Merged
merged 5 commits into from Oct 6, 2017

Conversation

lexmag
Copy link
Owner

@lexmag lexmag commented Oct 5, 2017

Closes #16.
Supersedes #19.

Not sure if we want support :prefix or not. 馃

lib/fluxter.ex Outdated
{child_options, options} =
Enum.split_with(options, fn {key, _value} ->
key in [:id, :start, :restart, :shutdown, :type, :modules]
end)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can use Keyword.split/2 here :).

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Definitely!

@@ -35,6 +35,10 @@ defmodule FluxterTest do
use Fluxter
end

defmodule FluxterXyzzy do
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why another module exactly like FluxterSample here? 馃

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to start one more Fluxter pool with start_link/1 options, unfortunately, it can't be FluxterSample because of name registration.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I see. What about a more "conventional" name then, like OtherFluxterSample?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I used Xyzzy since it is started with prefix: "xyzzy". About xyzzy itself: https://en.wikipedia.org/wiki/Xyzzy_(computing).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am 馃憥 on this name, I find it confusing and I don't think it fits well with FluxterSample above.

@lexmag lexmag merged commit 777677e into master Oct 6, 2017
@lexmag lexmag deleted the am/dynamic-config branch October 6, 2017 13:36
@rosacris
Copy link

rosacris commented Oct 6, 2017

What arguments do you pass to start_link in order to use the value of an environment variable as the influxdb hostname?

@lexmag
Copy link
Owner Author

lexmag commented Oct 6, 2017

The start_link/1 function supports :host, :port, and :prefix options.
Values for these options can be read in any preferable way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dynamic host/port config
3 participants