-
Notifications
You must be signed in to change notification settings - Fork 239
Make Events derive from a common abstract type #59
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
Comments
This would be very helpful for creating base classes and shared logic between different lambda functions or multiple triggers to the same function. |
I am also looking for this feature. I want to trigger my lambda function with SQSEvent/CloudWatchLogs Event. |
any updates on this? |
No, update. This may be considered in the future, but not at the moment. |
which interface do you think would be useful to introduce? Also wanted to learn more about what would differentiate |
resolving this issue as not planned. I would not recommend the proposed pattern with |
Use case: Create a lambda function that handles different event types
The handler class has to implement the RequestHandler interface with <T,String>, being T one of the event types. As those do not share a common ancestory type, we need to implement the handling of each event type as a separa te class, and hence a separate Lambda. Having a common ancestor type would allow to implement RequestHandler<LambdaEventAbstractType,String> and determine in the handler function the type of event by inspecting its class with event.getClass().
This would also be a more Object oriented design, with a group of closely related types having a common ancestor.
We can now do something similar by implementing RequestHandler<Object,String> but it is poorer design and too loose in terms of type control.
The text was updated successfully, but these errors were encountered: