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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Different system configurations #8

Closed
bilus opened this issue Nov 15, 2015 · 6 comments
Closed

Different system configurations #8

bilus opened this issue Nov 15, 2015 · 6 comments

Comments

@bilus
Copy link

bilus commented Nov 15, 2015

Is there a way to have different system configurations (based on command line arguments or config etc.)? The way I'm using component in a large app is that I have a "server" system and a "cli" system. The "cli" system doesn't have all bells and whistles of the "server" system (e.g. it doesn't need the web server) it uses a different logging subsystem etc. Is there a way to do that with your library?

Note that they don't exist at the same time.

@tolitius
Copy link
Owner

@bilus, you can definitely control the way states are created via configuration that can be passed in at runtime: https://github.com/tolitius/mount/blob/master/doc/runtime-arguments.md#passing-runtime-arguments

Depending on your use case, if you do / do not want to start certain states of an application, you can do that as well: https://github.com/tolitius/mount#start-and-stop-parts-of-application.

Another way I can think of to satisfy running an application in different modes, is to have a separate namespace for "cli" that would only :require states that this mode needs. mount won't start/stop states it does not know about, and if certain states are omitted from the namespace, they won't be visible to mount.

@tolitius
Copy link
Owner

@bilus also just added a Start an Application Without Certain States feature where you can create a sub systemfor cli

(* it's in mount-0.1.2-SNAPSHOT)

@bilus
Copy link
Author

bilus commented Nov 16, 2015

Thanks a lot for a prompt reply. I'll give it a try.

@tolitius
Copy link
Owner

@bilus you can try 0.1.4 it has more ways to start/stop states including swapping alternate implementations your cli sub app may use for a different logging system.

@bilus
Copy link
Author

bilus commented Nov 27, 2015

Thanks. Right now I'm working on a Ruby project but I'll get back to this. ;)

@tolitius
Copy link
Owner

@bilus, sure. feel free to reopen the issue if needed when you get to play with it.

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

No branches or pull requests

2 participants