- 
                Notifications
    
You must be signed in to change notification settings  - Fork 74
 
Rollup-boost uses ping/pong to test the connection is open #310
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
Conversation
| 
           The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Skipped Deployment
  | 
    
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wondering if this can be handled with a library like fastwebsockets since this is quite a common web socket functionality?
| 
           I checked on tungstine and there was not an internal support to do ping, not sure if others have support for it.  | 
    
          
 Client side implementations do not have heartbeat implemented by default. In the server side it is enabled, if they get a Ping they reply with a Pong.  | 
    
| let (activity_tx, mut activity_rx) = mpsc::channel::<()>(10); | ||
| 
               | 
          ||
| let timeout_task = tokio::spawn(async move { | ||
| let mut last_activity = Instant::now(); | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we get more functions? I thinks this part could be spawn_activity_task, next could be spawn_ping_task, wdyt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean putting this logic in functions?
| send_ping_tx.send(()).await.unwrap(); | ||
| }, | ||
| _ => { | ||
| println!("Received message: {:?}", msg); | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this debugging message?
This PR adds a ping/pong system over the Rollup-boost <-> Builder connection. The context of this PR is in #304.
The inbound websocket service will send ping messages to the builder if after some time interval x has not received any message from the builder. After sending the ping message, it will wait another n time duration to receive the pong message back.
The test still needs more work.