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

Allow users to plug-in custom serialization for remoting calls. #51

Closed
amanbha opened this issue Sep 6, 2019 · 11 comments
Closed

Allow users to plug-in custom serialization for remoting calls. #51

amanbha opened this issue Sep 6, 2019 · 11 comments

Comments

@amanbha
Copy link
Contributor

amanbha commented Sep 6, 2019

No description provided.

@behoyh
Copy link

behoyh commented Oct 21, 2019

Does this include users being able to make deserialization as strict or as flexible as desired?

@amanbha
Copy link
Contributor Author

amanbha commented Oct 21, 2019

@behoyh yes, it would use a user provided Serializer/Deserializer so it can do whatever it wants.

@behoyh
Copy link

behoyh commented Oct 21, 2019

I have an idea for how this should work... where do you say would be the best step in the Actor process to plug in the serializer?

@amanbha
Copy link
Contributor Author

amanbha commented Oct 21, 2019

@behoyh It would be needed both on the client and service side. On the service side it can be plugged in when registering the Actor. On the client side it can be plugged in while creating a ActorProxy. May be we need to introduce a ActorProxyFactory, user will create a ActorPrpoxyFactory which will take a serializer/deserializer and then use that factory to create ActorProxies.

@behoyh
Copy link

behoyh commented Oct 21, 2019

Very cool. How does the client create the ActorProxy? It sounds like the client might know too much about the request before it is sent.

I was thinking the request could be mapped to the service on a best effort basis based on how stringent the custom serializer/deserializer supplied by the user was.

Perhaps a warning could be emitted following a failed / incomplete mapping and a separate listener can act on that.

@amanbha
Copy link
Contributor Author

amanbha commented Oct 21, 2019

Very cool. How does the client create the ActorProxy? It sounds like the client might know too much about the request before it is sent.

I was thinking the request could be mapped to the service on a best effort basis based on how stringent the custom serializer/deserializer supplied by the user was.

Perhaps a warning could be emitted following a failed / incomplete mapping and a separate listener can act on that.

The serializer/deserializer needs to work both for request/response both on client and service side, so we will have to plug them in on both the sides. When you say failed/incomplete warning, is that a compile time or runtime thing?

@behoyh
Copy link

behoyh commented Oct 21, 2019

Oh right, I see it now. Would the serializer be required if there was deserializer specified?

Ideally I would have that as a runtime thing in Prometheus format and allow a separate structured logger to pick it up.

@amanbha
Copy link
Contributor Author

amanbha commented Oct 21, 2019

Oh right, I see it now. Would the serializer be required if there was deserializer specified?

Ideally I would have that as a runtime thing in Prometheus format and allow a separate structured logger to pick it up.

Yes both the things will be required.
The flow would be:

  1. Serialize arguments of actor method on Client side and send the request.
  2. On the service side, deserialize the request, get actor method arguments and call method on actor.
  3. Get the return value(or exception) from actor method, serialize it and send it as response to client.
  4. On the client side, get the response, deserialize to return type (or exception) and give it to user code.

@behoyh
Copy link

behoyh commented Oct 21, 2019

Got it. I will aim at implementing this!

@amanbha
Copy link
Contributor Author

amanbha commented Oct 21, 2019

Got it. I will aim at implementing this!

Great, thanks, looking forward tot he contribution!

@vinayada1
Copy link
Contributor

Covered by other issues related to serialization

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

No branches or pull requests

3 participants