DTask: a new awaitable type for distributed asynchronous workflows #114034
Replies: 1 comment 1 reply
-
Hi, i would like to better understand the usage. It would be helpful to explain what problem your solving and also how it works. Uses Redis to record state, what state? perhaps give a better fuller example: including requirements Redis for the distributed backplane to maintain some state.... incase something drops? "DTask is its distributed counterpart: it represents asynchronous operations that can span multiple machines." ? can you show this with the example... make it easier to understand what problem your solving, with an example which should the core advantage. asynchronous operations, are one where it does not need the current thread...and can be reallicated while it wait.. for non cpu required operation to complete ...mutiple task can each be awaited..so "asynchronous operations that can span multiple machines." is confusing you gave the following as an example;
|
Beta Was this translation helpful? Give feedback.
-
Over the past year, I’ve been working on an experimental library, and now it's ready to start gathering some early feedback: DTasks.
DTasks simplifies writing long-running distributed async operations. It does so by introducing two new awaitable types:
DTask
andDTask<TResult>
. Just asTask
can represent a locally asynchronous operation,DTask
is its distributed counterpart: it represents asynchronous operations that can span multiple machines.How it works
DTasks is built on top of the async/await pattern we're all familiar with, so you can use
DTask
as the return type of an async method and await other DTasks inside it. The API mirrors Task, including:DTask.Delay
,DTask.Yield
,DTask.WhenAll
,DTask.WhenAny
,DTask.CompletedTask
,DTask.FromResult
.DTasks are durable, meaning the state of the async method (its local variables) is automatically persisted, and distributed, as execution may resume on a different machine (just like a Task can resume on a different thread).
If you have used Microsoft's DTFx, all this may sound familiar. So, how is DTasks different?
DTask
) for representing distributed/durable operations.IDurableOrchestrationContext
).Check out the GitHub repository, and the provided samples with step-by-step guides to run them. I also included a roadmap with the project's current status and planned features.
Feedback
I'd like to know what you think about it! Is this approach useful? Could it be a valid alternative to existing solutions? Is it worth investing even more time into it?
A quick disclaimer: this library is currently pre-alpha. I know practical concerns like scalability and reliability are crucial, but at this stage I’ve focused on proving the concept. That said, feel free to ask anything and I’ll do my best to answer.
Runtime async (async2)
I'm not that sure how this would play with the new runtime async model. DTasks' dehydration/hydration strategy require the exsistence of a state machine and I don't know if developers can opt in/out any of either async model. What are your thoughts?
Beta Was this translation helpful? Give feedback.
All reactions