Robert
Skill issue serializing tasks
Yes, I want to immediately continue - sort of a fire and forget, however it happens that MySyncMethod is reached again before the previous SendToRedisCache is finished, is there a way to guarantee that SendToRedisCache2 will finish after SendToRedisCache1 has finished?
46 replies
Skill issue serializing tasks
So using this pattern, I face this problem
I have a sync method (which i cannot change) that needs to achieve this 2 things: create a json and send it to 2 places (1. to a redis cache, 2. to an appendblbo)
I do not wish to block the main thread for this so Task.Run would be used.
The issue I have is that my order of completion is not guaranteed, what mechanism or pattern should I use to guarantee the order of caching and sending to an append blob?
I have thought of using 2 concurrent queues (one for caching, one for uploading the append blob, as they are independent of each other) with long-running tasks, but I read it is not ideal, any ideas?
So essentially the same problem, how do I wait in the SendToRedisCache for the previous SendToRedisCache to finish before starting?
46 replies