an_toni.a
10/25/2024, 10:03 AM_feedFactory.CreateFeedAsync(feed.FeedUri).PipeTo(Self);
from https://petabridge.com/blog/akkadotnet-async-actors-using-pipeto/ is not recommended?
i was reading the newer info from https://petabridge.com/blog/async-await-vs-pipeto/ but understood that PipeTo might still be useful. i didn't read carefully yet thoughNomi
10/25/2024, 10:13 AMContinueTaskOnActorContext instead of PipeTo.
For example:
C#
// Run on thread pool and route back
int MyComputeHeavyTask(int param)
{
return FindNextPrime(param);
}
ContinueTaskOnActorContext(Task.Run(() => MyComputeHeavyTask(param)), result => {}, failure => {});
// Run deferred on background on the actor context (does not block the mailbox).
async Task<int> MyLongRunningActorTaskAsync(int param)
{
await Task.Delay(1000);
await EntityAskAsync<>(param);
return 1;
}
ContinueTaskOnActorContext(MyLongRunningActorTaskAsync(param)), result => {}, failure => {});an_toni.a
10/25/2024, 10:16 AMNomi
10/25/2024, 10:16 AM_selfan_toni.a
10/25/2024, 10:17 AMan_toni.a
10/25/2024, 10:17 AMan_toni.a
10/25/2024, 10:18 AMNomi
10/25/2024, 10:20 AMan_toni.a
10/25/2024, 10:23 AM