php-nats-streaming icon indicating copy to clipboard operation
php-nats-streaming copied to clipboard

reconnect to stan(nats streaming) within existing nats connection

Open mardachevdv opened this issue 6 years ago • 1 comments

hi @byrnedo i think should be a ability to check(and reconnect) for valid stan connection(nats streaming), not only nats server itself

nats streaming server can close(remove clientId) stan connections using hb_interval, hb_timeout, hb_fail_count but tcp and nats protocol connection are valid and isConnected() method return true

mardachevdv avatar Dec 19 '18 09:12 mardachevdv

Hi @mardachevdv,

Happy to hear you're using php-nats-streaming :)

Yeah, that is (from first glance) a valid request. I don't use php a whole lot right now, are you in any way interested in making a pull request?

Edit: having a quick look at the code it would seem to be to make 2 separate functions, one to connect to nats, one to stan, then add a stanReconnect function that just calls the second...

byrnedo avatar Dec 19 '18 09:12 byrnedo