Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
urionz opened this issue Jan 5, 2024 · 2 comments
Open

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

urionz opened this issue Jan 5, 2024 · 2 comments

Comments

@urionz
Copy link
Contributor

urionz commented Jan 5, 2024

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
Copy link
Contributor Author

urionz commented Jan 5, 2024

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.

@bruce1125
Copy link
Contributor

Do you mean something about generic? If so, I don't think that could work very well, because it represents that you need to use both generic and reflect at the same time, and in Go, it is definitely not a good idea.
Alternately,maybe you can consider using code-gen to generate different version API?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants