garro95 / desim

A discrete-time events simulation framework, written in rust, using the generator experimental feature
GNU General Public License v3.0
55 stars 9 forks source link

feature request: process interruption #3

Open quantverse opened 5 years ago

quantverse commented 5 years ago

Is it possible to implement process interruption in a similar way as in simpy?

garro95 commented 5 years ago

What should it do?

quantverse commented 5 years ago

Exactly this: https://simpy.readthedocs.io/en/latest/simpy_intro/process_interaction.html#interrupting-another-process

garro95 commented 5 years ago

Isn't it like yielding an Effect::Event(0.0, other), other being the other process you want to interrupt?

garro95 commented 5 years ago

Maybe we can make the context be a Result and make it an Err() when the woken up process is interrupted and maybe in other situations, waiting it to be what we pass to the process when resuming with the argument.

quantverse commented 5 years ago

I really like the idea with Result actually...so I guess this has to wait until generator resume arguments are implemented...