File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -62,6 +62,11 @@ pub enum ClientMessage {
62
62
/// Message
63
63
message : String ,
64
64
} ,
65
+ /// Negentropy Close
66
+ NegClose {
67
+ /// Subscription ID
68
+ subscription_id : SubscriptionId ,
69
+ } ,
65
70
}
66
71
67
72
impl Serialize for ClientMessage {
@@ -186,6 +191,7 @@ impl ClientMessage {
186
191
subscription_id,
187
192
message,
188
193
} => json ! ( [ "NEG-MSG" , subscription_id, message] ) ,
194
+ Self :: NegClose { subscription_id } => json ! ( [ "NEG-CLOSE" , subscription_id] ) ,
189
195
}
190
196
}
191
197
@@ -313,6 +319,16 @@ impl ClientMessage {
313
319
} ) ;
314
320
}
315
321
322
+ // Negentropy Close
323
+ // ["NEG-CLOSE", <subscription ID string>]
324
+ if v[ 0 ] == "NEG-CLOSE" {
325
+ if v_len != 2 {
326
+ return Err ( MessageHandleError :: InvalidMessageFormat ) ;
327
+ }
328
+ let subscription_id: SubscriptionId = SubscriptionId :: new ( v[ 1 ] . to_string ( ) ) ;
329
+ return Ok ( Self :: NegClose { subscription_id } ) ;
330
+ }
331
+
316
332
Err ( MessageHandleError :: InvalidMessageFormat )
317
333
}
318
334
You can’t perform that action at this time.
0 commit comments