-
Notifications
You must be signed in to change notification settings - Fork 101
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
Move Signals
back from ZServer
to Zope
?
#702
Comments
@d-maurer nowadays Python has a built-in signal library and I think that the old I hope this helps! |
Alessandro Pisa wrote at 2019-9-12 00:19 -0700:
@d-maurer nowadays Python has a built-in signal library and I **think** that the old `Signals` module should just go away.
I already replaced succesfully `registerHandler` from the old `Signals` module with `signal.signal` in this PR https://github.com/plone/plone.app.robotframework/pull/98/files.
I hope this helps!
`Signals` is using Python's `signal` (at least under "posix")
and provides an additional feature: handler chains.
This feature is nice as it facilitates modularity: a subcomponent
can register its own signal handlers and has no need to know
about other subcomponents. With Python's elementary `signal`,
there is a single global signal handler for each signal and
something must do the coordination (that is what `Signals` does).
|
Ok! Thanks for sharing :) |
I frequently used the option to use |
I never used the If possible I'd prefer to have it in a separate package (outside) Zope and Zope not depending on it: Each additional module in the core increases the maintenance burden; especially if it is only needed for very specific use cases. |
Michael Howitz wrote at 2019-9-13 01:24 -0700:
I never used the `Signals` package. If it is useful, I could be resurrected from the `ZServer` grave.
If possible I'd prefer to have it in a separate package (outside) Zope and Zope not depending on it: Each additional module in the core increases the maintenance burden; especially if it is only needed for very specific use cases.
"Signals" is small -- however, it tries to hide some differences
between Unix and Windows regarding signal handling (and, I, e.g.
cannot test the Windows part).
"Signals" will be significantly more difficult to use,
if Zope does not use it itself -- to ensure that its signal
behaviour is the last one activated.
The reason for this: handler for a signal are activated in reverse
reqistration order; Zope's signal handlers will typically terminate
the process - which means that they must be registered before
any other handler for the signal.
While is is possible to enfore an order in which components are
activated, it is not easy/straightforward. Therefore, Zope
should register its handlers before any application specific code
is activated.
|
So it is not in addition to the Zope features but requires at least a bit of interaction. |
I am currently porting a Plone application to Plone5.2/Zope 4 and noticed a problem with its use of
Signals.SignalHandler.registerHandler
.Formerly, Zope itself registered handlers for
SIGINT
andSIGTERM
. When an application registered its own handlers, the default behaviour (stop the process) was activated after the application specific handlers. Nowadays, Zope no longer registers its own handlers (likely becauseSignals
was moved toZServer
). When an application registers a signal handler for SIGINT or SIGTERM, the process no longer stops (unless the handler does the stopping).Like
webdav
,Signals
is not reallyZServer
dependent (i have the impression, that things not immediately fundamental toZope
had a tendency to get moved toZServer
). Should we move backSignals
fromZServer
toZope
and letZope
register again default signal handlers forSIGINT
andSIGTERM
?The text was updated successfully, but these errors were encountered: