Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add IRuntime in Future context #19

Open
DragonFrai opened this issue Oct 20, 2023 · 0 comments
Open

Add IRuntime in Future context #19

DragonFrai opened this issue Oct 20, 2023 · 0 comments
Labels
feature futures Assigned with futures module

Comments

@DragonFrai
Copy link
Owner

DragonFrai commented Oct 20, 2023

Various operations may depend on the current scheduler, or in general, runtime (a concept more extensible than the scheduler and not tied to it). For example, delay or wrapping synchronous I/O. Potentially, these more optimal implementations can be provided through runtime than through the standard asynchronous dotnet API. In addition, this will allow you to throw through the unique capabilities of runtime, although this will require dynamic determination of their capabilities, but sometimes this can be useful.
This has always been the reason for adding the scheduler to the Future context. There was also a reason for the really parallel launch of Future. But he looks completely clumsy there. And the allocation of runtime will allow you to more explicitly express the absence of a scheduler and, for example, call merge instead of running in parallel.

Context subtypes can also be a solution

An alternative solution would be to simply remove the scheduler from the context and not add a new entity and implement all the basic operations through the asynchronous dotnet API.
A similar mechanism can be implemented by binding information about the execution context via ThreadLocal, bypassing explicit transfer. This will allow to provide implementations tied to the runtime, but a general universal solution will most likely have to be avoided.

@DragonFrai DragonFrai added feature futures Assigned with futures module labels Oct 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature futures Assigned with futures module
Projects
None yet
Development

No branches or pull requests

1 participant