@@ -3,12 +3,11 @@ use async_trait::async_trait;
33use bytes:: Bytes ;
44use http_body_util:: Full ;
55use hyper:: { Request , Response } ;
6- use rivet_runner_protocol as protocol;
7- use rivet_util:: Id ;
86use tokio_tungstenite:: tungstenite:: protocol:: frame:: CloseFrame ;
97
108use crate :: WebSocketHandle ;
11- use crate :: proxy_service:: ResponseBody ;
9+ use crate :: request_context:: RequestContext ;
10+ use crate :: response_body:: ResponseBody ;
1211
1312pub enum HibernationResult {
1413 Continue ,
@@ -22,21 +21,14 @@ pub trait CustomServeTrait: Send + Sync {
2221 async fn handle_request (
2322 & self ,
2423 req : Request < Full < Bytes > > ,
25- ray_id : Id ,
26- req_id : Id ,
27- request_id : protocol:: RequestId ,
24+ req_ctx : & mut RequestContext ,
2825 ) -> Result < Response < ResponseBody > > ;
2926
3027 /// Handle a WebSocket connection after upgrade. Supports connection retries.
3128 async fn handle_websocket (
3229 & self ,
30+ _req_ctx : & mut RequestContext ,
3331 _websocket : WebSocketHandle ,
34- _headers : & hyper:: HeaderMap ,
35- _path : & str ,
36- _ray_id : Id ,
37- _req_id : Id ,
38- // Identifies the websocket across retries.
39- _request_id : protocol:: RequestId ,
4032 // True if this websocket is reconnecting after hibernation.
4133 _after_hibernation : bool ,
4234 ) -> Result < Option < CloseFrame > > {
@@ -46,10 +38,8 @@ pub trait CustomServeTrait: Send + Sync {
4638 /// Returns true if the websocket should close.
4739 async fn handle_websocket_hibernation (
4840 & self ,
41+ _req_ctx : & mut RequestContext ,
4942 _websocket : WebSocketHandle ,
50- _ray_id : Id ,
51- _req_id : Id ,
52- _request_id : protocol:: RequestId ,
5343 ) -> Result < HibernationResult > {
5444 bail ! ( "service does not support websocket hibernation" ) ;
5545 }
0 commit comments