Faced with a problem that I can’t execute Task immediately after caching. Not sure if I’m doing something wrong or if it’s a problem with the chosen solution.
In short, what’s going on here. There is S3 compliant storage that I want to work with and I have chosen AWSSDK.S3 nuget for this. It uses asynchronous calls. But the thing is, you have to cache these calls each time before sending them. And it turns out that I can’t call the function I need with a button - I have to cache it first, then call the execution of the task.
Am I doing something wrong? Maybe I’m missing something?
@sebl Might you have some thoughts on how to develop the following idea: creating a chain of calls? When I use ManageTask I get an Observable and can use ForEach for example. But if I use ManageTask inside ForEach (Observable), I get Observable<Observable>. What is the best way to preserve the Async structure and still easily create call chains?
Please have a look at the HowTo Chain Tasks from the Helpbrowser in the previews. The patch shows Then, Then (Value) and ThenDo regions for chaining tasks.
@robotanton Thank you so much! Very valuable insight!
I’ve already wrapped everything in ManageTask
Is there something similar for Observable? Although perhaps a scheme with channels would be even more convenient!
I have a small question and concern. I am currently using TelegramBot (22.7) and want to use the DownloadFile method.
The method is parsed in such a way that it gives Task (NonGeneric) output from the node. But in a pipeline consisting of Then and ThenDo, there is no place for such functions. Yes, the function is executed (I use it in the ThenDo operation), but I have a question: is this equivalent to await? Or in this case, we cannot track whether this function has been executed or not? It seems that the function is launched, but it is impossible to wait for its execution, the execution rushes on as if I did not manage to do anything.
Where the function has a result, chaining works smoothly and beautifully. But where the function has no result, a problem arises.
I made a simple illustration, but I think it may not be very clear. If it’s difficult to understand what I mean, I can try to explain it better.
@gregsn Thank you very much! That’s a very good solution; I was probably close to something like that in all my experiments. I feel like it’s worth adding to the main API, although I’m not sure if the names are appropriate.
I would, of course, be happy if others joined the discussion.