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

Strongly typed Runnables #92

Open
cohix opened this issue May 12, 2021 · 1 comment
Open

Strongly typed Runnables #92

cohix opened this issue May 12, 2021 · 1 comment
Labels
core Related to the internals of Reactr such as the scheduler enhancement New feature or request

Comments

@cohix
Copy link
Contributor

cohix commented May 12, 2021

Currently Runnables accept an interface{} as their Job payload. This causes issues with type coercion, and it simply a bad pattern for the long term.

I propose the concept of a Superfunc which is a 'regular Go function' that returns a Result. This user defined Superfunc would return a function whose signature is understood by Reactr. Reactr would be able to execute it like any other Runnable, and would harldly know the difference. Because the function actually being executed has references to the strongly typed input parameters, this allows for a strongly typed API (that can be codegen'd!) without needing to completely overhaul Reactr.

@cohix cohix added enhancement New feature or request core Related to the internals of Reactr such as the scheduler labels May 12, 2021
@cohix
Copy link
Contributor Author

cohix commented May 12, 2021

This proposal is being implemented in #81

This was referenced May 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Related to the internals of Reactr such as the scheduler enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant