38 posts
Posted 18 February 2017 - 08:35 PM
How will I go along creating a coroutine manager? I'm having some trouble switching between coroutines (both start, then then one continues without switching back to the other, also only one receives info from the event).
2427 posts
Location
UK
Posted 18 February 2017 - 09:34 PM
Two things:
first,
BBs guide to coroutines second, have a look at how the
built in coroutine manager works
1583 posts
Location
Germany
Posted 18 February 2017 - 10:29 PM
Most of the time people ask how to write their own coroutine manager the standard parallel API is enough already. Have you tried parallel and are not satisfied with it?
38 posts
Posted 18 February 2017 - 10:59 PM
Most of the time people ask how to write their own coroutine manager the standard parallel API is enough already. Have you tried parallel and are not satisfied with it?
I have tried, and it just can't work in the way I need it too
1583 posts
Location
Germany
Posted 19 February 2017 - 01:22 AM
Most of the time people ask how to write their own coroutine manager the standard parallel API is enough already. Have you tried parallel and are not satisfied with it?
I have tried, and it just can't work in the way I need it too
in addition to Lupus stuff here's a general idea of how a simple coroutine manager kinda works:
loop until every coroutine is dead -> fetch an event -> loop over every coroutine and check if has an event filter and is not dead; compare the event to the filter and if no filter is set or it fits the filter resume the coroutine with the unpacked event as arguments, save the return value as new filter -> repeat