the-moisrex / webpp

C++ web framework | web development can be done with C++ as well.
https://t.me/webpp
MIT License
132 stars 9 forks source link

Task Chain #382

Open the-moisrex opened 1 year ago

the-moisrex commented 1 year ago

Task Chains are an idea for the Event Manager idea. They represent a chain of task/io-operations/events that will be passed to the execution context and the execution context starts to run them and handle with the errors.

Types of tasks:

Features:

Other usages:

Chains:

the-moisrex commented 1 year ago

yielding can be just an iterator

the-moisrex commented 1 year ago

But what would be a consumer, if the yielder is an iterator?

the-moisrex commented 1 year ago

Another question:

How we should pass the yeilded value to the consumer?

the-moisrex commented 1 year ago

Idea:

the-moisrex commented 1 year ago
the-moisrex commented 1 year ago

TaskChain

Task

TaskState (Not-Iterator)

Dynamic Task State

Execution Context (can it be an special TaskState?)

the-moisrex commented 1 year ago
the-moisrex commented 1 year ago

idea:

what if instead of taking a scheduler or something a-like as the first input of the algorithms, we take an operation state?

Operation State requirements:

the-moisrex commented 1 year ago

idea:

Each task would get an Operation State Token which is a kinda-pointer to the real deal and whoever (of the execution contexts) has it owns the operation.

So when a syscall is made into the io execution context, we pass the token as a callback; then the io execution context either