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

How about make *Manager.Run() return? #44

Open
JokerQyou opened this issue Apr 22, 2020 · 2 comments
Open

How about make *Manager.Run() return? #44

JokerQyou opened this issue Apr 22, 2020 · 2 comments

Comments

@JokerQyou
Copy link

func (mgr *Manager) Run() currently does not return, instead, it calls func (mgr *Manager) Terminate() which in turn calls os.Exit(). I was trying to embed the worker logic with my own goroutines, and defers are required for various operations, but os.Exit() breaks them.

Is there any specific reason why Run() does not return? If not, can we change it to return, or at least make it configurable to do so?

@mperham
Copy link
Contributor

mperham commented Apr 22, 2020

I envisioned fwg as a framework which controls the process, not a library where you control the process. It installs signal handlers and makes other such global Process changes.

I don't want to make it configurable but I can see a possible new Start API which Run calls that does what you need. You could choose to call it instead.

@JokerQyou
Copy link
Author

That would be very much appreciated.

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