You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
After I call can.notifier.Notifier.stop not a Notifier object, there is no obvious way how to restart the Notifier.
As far as I see, I need to create a new notifier, which leads to another problem - if a Bus is added to two Notifiers (even if one of them is stopped) then an exception is raised by can.notifier._NotifierRegistry.register.
Describe the solution you'd like
I would like a restart method defined in Notifier class which would work exactly like I just created a new Notifier with the exactly the same settings as the existing one.
Describe alternatives you've considered
can.notifier._NotifierRegistry.register does not raise an exception if another Notifier is stopped
@gravesmiOSU I saw your PR, but i think stopping and restarting the Notifier will cause too many problems. Calling Notifier.stop() also calls the stop method of the listeners, which causes resources to be closed and cleaned up. Also the receive buffer of the bus will overflow.
I think something like pause() and unpause() could work (although i don't like the names), where the incoming messages are just dismissed in Notifier._on_message_received.
@gravesmiOSU I saw your PR, but i think stopping and restarting the Notifier will cause too many problems. Calling Notifier.stop() also calls the stop method of the listeners, which causes resources to be closed and cleaned up. Also the receive buffer of the bus will overflow.
I think something like pause() and unpause() could work (although i don't like the names), where the incoming messages are just dismissed in Notifier._on_message_received.
can.listener.Listener has stop method, but no resume / restart / unpause
can.listener.AsyncBufferedReader does not have exposed _is_stopped attribute (it can be stopped, but there is no good way to check whether it happened)
Activity
zariiii9003 commentedon Feb 22, 2026
Notifier._registry.unregister(bus, self)is called at the end ofNotifier.stop():python-can/can/notifier.py
Line 219 in e3d2655
Did you get some exception before that line?
Edit: The exception is raised only if the Notifier is not stopped:
python-can/can/notifier.py
Line 58 in e3d2655
Use
Notifier.find_instances()to debug.mdabrowski1990 commentedon Feb 23, 2026
It is possible that exception with bus collision was my coding mistake.
Yet, I would appreciate you could add
restartNotifier feature though.gravesmiOSU commentedon May 11, 2026
Added a pull request that contains this feature request and some new testing to potentially address. Hope this helps.
zariiii9003 commentedon Jun 6, 2026
@gravesmiOSU I saw your PR, but i think stopping and restarting the Notifier will cause too many problems. Calling
Notifier.stop()also calls thestopmethod of the listeners, which causes resources to be closed and cleaned up. Also the receive buffer of the bus will overflow.I think something like
pause()andunpause()could work (although i don't like the names), where the incoming messages are just dismissed inNotifier._on_message_received.@mdabrowski1990 what do you think?
mdabrowski1990 commentedon Jun 8, 2026
Sounds great. Thank you!
mdabrowski1990 commentedon Aug 30, 2026
I also noticed that:
can.listener.Listenerhasstopmethod, but noresume/restart/unpausecan.listener.AsyncBufferedReaderdoes not have exposed_is_stoppedattribute (it can be stopped, but there is no good way to check whether it happened)