Makes (Kite).callOn method impelementations on a par with *Client ones.
kite: fix panic ignoring
The recover method should be called from within a function, not be a deferred function itself.
tokenrenewer: improve fix for a panic #187
The error returned by kontrol is different than
the ErrKitNotAvailable, that's why the assert
on message content.
Moreover the renewLoop lifetime handling was
improved:
"kite not found" errors do not cause the goroutine
to exit - they're just ignored instead, in case
a heartbeat went through and kite was again
registered to kontrol without local Kite knowing it
(no OnConnect handler gets executed then); this
is an assumption, I did not manage to write a test
to prove it
we wait for previous renewLoop to die before
starting a new one
A number of changes:
Makes (Kite).callOn method impelementations on a par with *Client ones.
The recover method should be called from within a function, not be a deferred function itself.
The error returned by kontrol is different than the ErrKitNotAvailable, that's why the assert on message content.
Moreover the renewLoop lifetime handling was improved:
"kite not found" errors do not cause the goroutine to exit - they're just ignored instead, in case a heartbeat went through and kite was again registered to kontrol without local Kite knowing it (no OnConnect handler gets executed then); this is an assumption, I did not manage to write a test to prove it
we wait for previous renewLoop to die before starting a new one