Support multiplexing with graphql-ws subprotocol #3569
Labels
module/graphql
Issues related to Ballerina GraphQL module
Points/9
Team/PCM
Protocol connector packages related issues
Type/Improvement
Milestone
Description:
Multiplexing is not supported by the current graphql subscription implementation when utilizing the graphql-ws/graphql-transport-ws subprotocol.
To handle the multiplexing properly, the incoming messages to the
onTextMessage
handler must be processed concurrently.Regarding the current behaviour of the
onTextMessage
handler, this handler is not dispatched concurrently for received text messages, rather it gets dispatched frame by frame while waiting for the completion of the precedingonTextMessage
call. To handle the text message concurrently, we may add a worker inside theonTextMessage
handler.By making this change, the handler will be able to get the
complete
message even when messages are in-flight to the client.Once the server has received this
complete
message from the client, it can stop processing the stream. If we don't stop processing the stream after receiving thecomplete
message, the server will max out with the load. (Current implementation doesn't handle this scenario)Note: Adding a worker inside the
onTextMessage
function would necessitate converting every Node class in the graphql package into an isolated class, which might result in performance degradation.Related Issues (optional):
Suggested Labels (optional):
Suggested Assignees (optional):
The text was updated successfully, but these errors were encountered: