lundi 11 février 2019

C# which pattern to use to have synchronous and pub/sub scenario for long-running task

Let's say I have an image processing library and I need it to work both ways - synchronously and as a pub/sub pattern. So the first method ProcessBigListOfImages doesn't return until it's done. And the second method ProcessBigListOfImagesStart should return instantaneously with some kind of subscription information (and better with a progress feedback), so it's invoked by that process somewhere down the road.

Now, this is what I need when use local file system and Azure compute and storage. Two different platforms but similar tasks. I want to have the same API. Is this doable?

I probably need to read again some books on design patterns just to refresh my memory...

Aucun commentaire:

Enregistrer un commentaire