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

More a question than an issue #21

Closed
marcoooo opened this issue Sep 13, 2017 · 1 comment
Closed

More a question than an issue #21

marcoooo opened this issue Sep 13, 2017 · 1 comment

Comments

@marcoooo
Copy link

Hello, I am glad to have found your package after such a long time looking for something simple to run my Django app command inside as a daemon !

I was wondering if there is a way to use daemonizer decorator to stop the process ?

@kevinconway
Copy link
Owner

There is! Once the decorator is applied it replaces the original function object with the daemon manager. This allows you to call stop() on the function to terminate the daemon. Here is an example.

Some call outs that you may be aware of but are worth mentioning anyway:

  • Once wrapped, the function call starts acting like a singleton and will only have one running daemon at a time. If you need to start a daemon for each call then the decorator is insufficient for your use case.

  • The wrapped function needs to manage its own loop if you only use the @run decorator. If you have a function that you want to run repeatedly from the daemon then the @step decorator will work just like @run but will put your function in an infinite loop. Both versions can be stopped by calling the stop() function added to the wrapped function object.

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