cookie-cutter icon indicating copy to clipboard operation
cookie-cutter copied to clipboard

There is no check for a output to have a corresponding sink

Open dbalagula opened this issue 5 years ago • 1 comments

The following case:

    Application.create()
        ...
        .dispatch(new {
            onEvent(msg: IEvent, ctx: IDispatchContext): void {
                ctx.publish(Response, {});
            }
        })
        .output()
            .stored(cosmosSink(cosmosConfigNew))
            .done()

does not throw an error even though there is no sink connected to publish. I think it would be a good check to make sure outputs have a corresponding sink.

dbalagula avatar Jan 30 '20 18:01 dbalagula

that's a good idea ... we already assign a default sink if you don't explicitly hook up a sink (the NullSink). We could easily change the implementation of it to throw an error vs. being a no-op.

sklose avatar Jan 30 '20 19:01 sklose