-
Hi! I'm building a console application using generic host and MediatR. For short running commands / queries I can straightforwardly send a command, await response and write to console whatever I need. My issue arises when I have a compound command that needs to do a lot of work: fetch some data, validate it, process it and return response. While that is happening, I want to show progress in CLI (just by printing some information to the user as to what is happening). I'm new to MediatR and I'm not sure what would be considered a good pattern to achieve what I need. I see a couple of options, which I'm going to list, but maybe there's something completely other than that which would actually be the way to go. Here are my ideas so far:
Regards |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I've never had to deal with this kind of scenario as MediatR was designed for more synchronous stuff, but you might look at a solution without MediatR then look to see if what comes out is appropriate to put inside a handler. If not, then just leave MediatR out of equation. |
Beta Was this translation helpful? Give feedback.
I've never had to deal with this kind of scenario as MediatR was designed for more synchronous stuff, but you might look at a solution without MediatR then look to see if what comes out is appropriate to put inside a handler. If not, then just leave MediatR out of equation.