Yui
Yui
CC#
Created by Yui on 2/6/2024 in #help
Stream Throttling
mhm, makes sense
130 replies
CC#
Created by Yui on 2/6/2024 in #help
Stream Throttling
So, to bring the topic of asynchronous operations back to stream throttling; they're necessary for stream throttling because you need to process the necessary information ( incoming buffer, whether or not the cooldown has been reached, etc. ) all while the stream is reading, which would be classified as asynchronous operations?
130 replies
CC#
Created by Yui on 2/6/2024 in #help
Stream Throttling
Well, this was always a simple concept, which is why I was so surprised it was taking so long to click
130 replies
CC#
Created by Yui on 2/6/2024 in #help
Stream Throttling
It has clicked in my brain though, fortunately :)
130 replies
CC#
Created by Yui on 2/6/2024 in #help
Stream Throttling
It was good, I understand the actual application of it now, though I'll continue to read the sources you provided in hopes of learning more in-depth information about it.
130 replies
CC#
Created by Yui on 2/6/2024 in #help
Stream Throttling
Or is that a different use-case?
130 replies
CC#
Created by Yui on 2/6/2024 in #help
Stream Throttling
Wait, so if you defined a variable resulting from the the order, such as with
var meal = await yourOrder();
var meal = await yourOrder();
It would return to that line afterwards?
130 replies
CC#
Created by Yui on 2/6/2024 in #help
Stream Throttling
Whereas, if you just asynchronously execute the task on it's own without defining it as an action, it waits it's turn?
130 replies
CC#
Created by Yui on 2/6/2024 in #help
Stream Throttling
I see, so as long as the Task is defined as an action beforehand, it will execute the asynchronous task before everything else?
130 replies
CC#
Created by Yui on 2/6/2024 in #help
Stream Throttling
:Thumbs_Up:
130 replies
CC#
Created by Yui on 2/6/2024 in #help
Stream Throttling
Well, obviously in this case just swapping them would simply get it done, but the idea I have of asynchronous methods is one that allows the asynchronous method to execute and then step out of the way so the next lines can run while the method processes, regardless of how long it takes.
130 replies
CC#
Created by Yui on 2/6/2024 in #help
Stream Throttling
Of course, in my quick run of it, that's not the way it goes ^
130 replies
CC#
Created by Yui on 2/6/2024 in #help
Stream Throttling
Through my perception of this concept, the dothingy method should finish before the WorkAsync task.
130 replies
CC#
Created by Yui on 2/6/2024 in #help
Stream Throttling
I wrote this very tiny piece for a console application
public static async Task Run()
{
var t = WorkAsync();

await t;
dothingy();
}

public static void dothingy()
{
Console.WriteLine($"Alright, I hope I go first...");
}
public static async Task WorkAsync()
{
await Task.Delay(1000);
Console.WriteLine($"Wooo, I asynchronously finished!");
}
public static async Task Run()
{
var t = WorkAsync();

await t;
dothingy();
}

public static void dothingy()
{
Console.WriteLine($"Alright, I hope I go first...");
}
public static async Task WorkAsync()
{
await Task.Delay(1000);
Console.WriteLine($"Wooo, I asynchronously finished!");
}
130 replies
CC#
Created by Yui on 2/6/2024 in #help
Stream Throttling
Hmm, I see but am still not completely clicking
130 replies
CC#
Created by Yui on 2/6/2024 in #help
Stream Throttling
Is that an inaccurate way of looking at it?
130 replies
CC#
Created by Yui on 2/6/2024 in #help
Stream Throttling
I'm going to go ahead and check out the article, but it sounds as if that's not a thread then, at least from my perspective? I, similar to probably many others, and accustomed to the idea that a a Thread runs at the same time or as/parallel to the code in front of it, not afterwards.
130 replies
CC#
Created by Yui on 2/6/2024 in #help
Stream Throttling
And this allows the task to run as/on a thread without interrupting actions ahead of it, or am I being dense at the moment?
130 replies
CC#
Created by Yui on 2/6/2024 in #help
Stream Throttling
If it's hard to explain with words, maybe you could try writing a very simple example out?
130 replies
CC#
Created by Yui on 2/6/2024 in #help
Stream Throttling
Such as with here --------^
130 replies