rxxpress
rxxpress copied to clipboard
Unify operator "message" option type / interface
Many operators respond to incoming requests with preset status / messages. These status / messages are not fed to operators in a unified manner, some operators do not accept one (timeout()
), some operators accept them directly as parameters (reject()
) and others get them as part of an options
object (check()
).
Further more, the current situation does not allow for custom messages per request, which limits applicability. I would propose moving to a unified API, and all operators also accepting functions (sync or async) that would generate the message based on packet. I suspect passing them as part of an options
object in a unified manner would result in a more readable outcome.