I have 2 questions: 1. Whenever I make a call with...
# kotlinx-rpc
j
I have 2 questions: 1. Whenever I make a call with RPC, I basically check whether the existings Ktor Rpc Client's web socket session is still active. If it isn't active or doesn't exist, I create a new one. This seems to be working, but is this how it is supposed to be? πŸ™‚ (I sometimes reboot my server so I will lose connections and I'd like to reconnect) 2. Whenever I use a flow in my RPC client, when I lose connection it is kinda done. Is there a built-in way to retry the flow connection? Or should I also work around this myself?
a
Reconnection is not supported out of the box, so yeah, for now only some tricks work
is this how it is supposed to be?
No, but we don't have enough hands for now to fix that It is planned though
j
okay then I will make my flow workaround πŸ™‚
thanks for the answre!
a
Great! You can also share your way here so other can look into it
j
It may not be pretty what I will be doing πŸ˜„
😁 1
One more question: If I call myRpcService.getFlow() (and I do not start collecting it), should I expect it to throw errors? Or only while I am collecting it?
a
no, the rpc call is cold, executed on the first collect
j
cool, that allows me for some cleanup
πŸ™Œ 1
a
I am literally doing the same thing
j
Is there still a pinginterval parameter somewhere?
I would like my flow to die after losing connection πŸ˜„
I could see a pingInterval somewhere mentioned in the history of this chat, but it does look like it may not exist πŸ˜„ Is there a way to check if the connection for a flow is still alive by pinging it?
a
I would like my flow to die after losing connection
It should, it probably doesn't due to https://github.com/Kotlin/kotlinx-rpc/pull/505 Will be there in 0.10.1
Is there still a pinginterval parameter somewhere?
No, only if WS session has one
but it does look like it may not exist
People write it themselves
Is there a way to check if the connection for a flow is still alive by pinging it?
WS alive -> flow is alive, except for the bug I mentioned above
j
okay cool πŸ™‚ What happens if connection is lost if the bug is fixed?
IOException thrown or something? πŸ™‚
a
flow will throw cancellation
on the collection point
j
okay thanks πŸ™‚