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

Typed signatures for event handlers #37

Merged
merged 5 commits into from
Aug 6, 2024
Merged

Conversation

pavelpatrin
Copy link
Collaborator

Previously, the event handler service in gontainer was quite primitive, allowing only one way to define an event handler with the func(args ...any) [error] signature. This approach is not convenient when working with well-defined types directly in the function signature, such as func(arg1 string, arg2 int, arg3 bool) [error].

This pull request enhances the gontainer by adding support for typed event handlers. Now, developers can define event handlers with specific argument types, making the code more readable and type-safe.

Signed-off-by: Pavel Patrin <ppatrin@nvidia.com>
Signed-off-by: Pavel Patrin <ppatrin@nvidia.com>
Signed-off-by: Pavel Patrin <ppatrin@nvidia.com>
@pavelpatrin pavelpatrin changed the title Typed signatures for event handlers. Typed signatures for event handlers Aug 4, 2024
* Typed signatures for event handlers: variable args.

Signed-off-by: Pavel Patrin <ppatrin@nvidia.com>
Signed-off-by: Pavel Patrin <ppatrin@nvidia.com>
@pavelpatrin pavelpatrin merged commit 6754127 into main Aug 6, 2024
1 check passed
@pavelpatrin pavelpatrin deleted the typed-event-handlers branch August 6, 2024 15:44
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

Successfully merging this pull request may close these issues.

1 participant