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

Make GenericAWSRequestHandler do the JSON deserialization and handler calling #162

Open
XerTheSquirrel opened this issue Aug 31, 2018 · 1 comment
Labels
enhancement Improves the library by adding a new feature! P3:Improvement
Milestone

Comments

@XerTheSquirrel
Copy link
Contributor

The raw JSON data is passed in the entry point implements RequestStreamHandler. Since this gives access to the raw JSON data, we can handle JSON deserialization ourselves and then support calling into either RequestHandler or just forwarding the streams to RequestStreamHandler.

This will have the advantage of doing JSON deserialization any way we want rather than forcing how Amazon does it.

This will break compatibility if any other code uses GenericAWSRequestHandler as a RequestHandler (a wrapper on top of IOpipe?).

This should be researched.

@XerTheSquirrel XerTheSquirrel added the enhancement Improves the library by adding a new feature! label Aug 31, 2018
@XerTheSquirrel XerTheSquirrel added this to the Backlog milestone Aug 31, 2018
@XerTheSquirrel
Copy link
Contributor Author

I had a thought that compatibility is no issue at all, these are two different interfaces and they can be implemented since they provide two different methods (they have different descriptors). This means:

  • Does not break compatibility.
  • GenericAWSRequestHandler implements both RequestHandler and RequestStreamHandler.
  • AWS should prefer the stream based handler, which may be faster.
  • Existing code that uses RequestHandler it will still work.
  • The generic handler, at least the code being used, I believe the library it uses serializes to JSON then deserializes that to the target object. If this is actually how it works, then this would reduce latency to handling the events.

If this is done, then there would have to be an internal extra method which forwards to the desired code to be executed, to prevent the input object being processed multiple times.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improves the library by adding a new feature! P3:Improvement
Projects
None yet
Development

No branches or pull requests

2 participants