pitaya icon indicating copy to clipboard operation
pitaya copied to clipboard

Can you provide a way to custom respond to request type message?

Open urionz opened this issue 2 years ago • 2 comments

Can you provide a way to manually respond to requests?

I have a specific scenario that requires asynchronously returning the request type message result. I hope to provide a handler type so that we can manually execute session.ResponseMID for response when needed.

Or can you provide me with some suggestions?

urionz avatar Jan 05 '24 03:01 urionz

AsyncResponseHandlerType(ctx context.Context, mid uint, msg []byte|Pointer) error|void

Although currently it is possible to achieve the same effect by using client listen push route message.

urionz avatar Jan 05 '24 03:01 urionz

I see. For now, "requesting" using notify with the client and sending the answer back using push as you mentioned is the best way to achieve this. This is not a use case we intend to support for now because we don't need it internally. Feel free to send a PR though

felipejfc avatar Aug 13 '24 12:08 felipejfc