-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SwarmClient re-connection to WebSocket #89
Comments
I'm guessing you're using the This transport is simply using RxJS' import { SwarmClient } from '@erebos/swarm-browser'
import PssAPI from '@erebos/api-pss'
import StreamRPC from '@mainframe/rpc-stream'
import { WebSocketSubject } from 'rxjs'
const transport = new WebSocketSubject({
// Config with url, openObserver and closeObserver
})
const rpc = new StreamRPC(transport)
const pss = new PssAPI(rpc)
const client = new SwarmClient({ pss }) Then it would be part of your application logic to recreate the client as needed. |
@PaulLeCam thanks for advice, I try it later today |
It took a while to implement it, coz it was a bit more complicated. I didn't use I took reference implementation of WebSocketSubject wrapper https://gearheart.io/blog/auto-websocket-reconnection-with-rxjs-with-example Here is my implementation okamilab/nebula@881470f |
Nice, thanks for sharing! What errors did you get using |
leads to an error on application startup
|
Thanks for the details! |
I use
@erebos/swarm-browser
package in order to communicate with swarm in my app.When I restart swarm, erebos package throws an error
Connection failed
and it is not possible to continue work with app, in order to fix it I need to refresh the app.Do you have any ideas how to implement automatic re-connection of
SwarmClient
The text was updated successfully, but these errors were encountered: