feat(phoenix-channel): remove concept of "inbound requests" (#3831)

We don't have a concept of "inbound requests", at least not natively in
the phoenix channel JSON format. Thus, we don't need to match on `ref`
for incoming messages.

Extracted out of: #3682.
This commit is contained in:
Thomas Eizinger
2024-03-02 02:53:08 +11:00
committed by GitHub
parent 7217f27af1
commit 9d8233a406
2 changed files with 7 additions and 22 deletions

View File

@@ -342,20 +342,12 @@ where
};
match message.payload {
Payload::Message(msg) => match message.reference {
None => {
return Poll::Ready(Ok(Event::InboundMessage {
topic: message.topic,
msg,
}));
}
Some(reference) => {
return Poll::Ready(Ok(Event::InboundReq {
req_id: InboundRequestId(reference),
req: msg,
}))
}
},
Payload::Message(msg) => {
return Poll::Ready(Ok(Event::InboundMessage {
topic: message.topic,
msg,
}))
}
Payload::Reply(Reply::Error { reason }) => {
return Poll::Ready(Ok(Event::ErrorResponse {
topic: message.topic,
@@ -527,11 +519,6 @@ pub enum Event<TInboundMsg, TOutboundRes> {
topic: String,
msg: TInboundMsg,
},
/// The server sent us a request and is expecting a response.
InboundReq {
req_id: InboundRequestId,
req: TInboundMsg,
},
Disconnect(String),
}

View File

@@ -523,9 +523,7 @@ where
tracing::debug!(target: "relay", "Heartbeat sent to portal");
continue;
}
Some(Poll::Ready(Ok(
Event::InboundMessage { msg: (), .. } | Event::InboundReq { req: (), .. },
)))
Some(Poll::Ready(Ok(Event::InboundMessage { msg: (), .. })))
| Some(Poll::Pending)
| None => {}
}