Open JustinTArthur opened 5 years ago
It seems like adding wamp.close.goodbye_and_out
to the list of "close messages that are considered normal and final" is a good idea.
What about wamp.close.system_shutdown
, wamp.close.close_realm
and wamp.close.system_shutdown
? Conversely, maybe any wamp.close.*
should be considered fine and normal and only wamp.close.protocol_violation
should be considered an error?
Error or not, we may still want to stop reconnection behavior after we've sent our own goodbye.
A work-around for now is to pass an is_fatal
predicate function that returns True
for any of the ApplicationError
strings you want (beyond wamp.close.normal
which will already end the re-connections).
Oh, and there's also Component.stop
which should call .leave()
on a session (if there is one) and then stop the component re-connecting etc (and once all the Component
s given to run
are stopped, the process should exit).
If a router replies to Autobahn's goodbye with a standards-compliant response like
wamp.close.goodbye_and_out
, the Component establishes a new connection. This will continue in an infinite loop.The router's goodbye reply results in the protocol's success callback firing a new "leave" event. This triggers the Component's leave handler, which considers any leaving reason beyond
wamp.close.normal
to be an error, triggering a new connection somewhere downstream in the Component behaviors.