reactr
reactr copied to clipboard
Strongly typed Runnables
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.
This proposal is being implemented in https://github.com/suborbital/reactr/pull/81