arcs icon indicating copy to clipboard operation
arcs copied to clipboard

Pass CoroutineScope instead of CoroutineContext in ArcHosts.

Open yuangu-google opened this issue 5 years ago • 5 comments

yuangu-google avatar Nov 06 '20 22:11 yuangu-google

Hmm, it seems Jason actually wants to pass in a dispatcher for serialization. But I think client should have more control over this behavior: shall we just move serialization into a separate component and pass it in?

yuangu-google avatar Nov 06 '20 22:11 yuangu-google

You'll probably want to do this change as a CL rather than a PR, so that you can also update the code on the g3 side.

jblebrun avatar Nov 06 '20 22:11 jblebrun

Hmm, it seems Jason actually wants to pass in a dispatcher for serialization. But I think client should have more control over this behavior: shall we just move serialization into a separate component and pass it in?

I think this is the best approach long term. But doing this cleanup and using the CoroutineDispatcher for now would be a reasonable stepping-stone, too.

jblebrun avatar Nov 06 '20 22:11 jblebrun

Hmm, it seems Jason actually wants to pass in a dispatcher for serialization. But I think client should have more control over this behavior: shall we just move serialization into a separate component and pass it in?

I think this is the best approach long term. But doing this cleanup and using the CoroutineDispatcher for now would be a reasonable stepping-stone, too.

Might be worthwhile as seems short-term solutions ultimately causes us more troubles.

yuangu-google avatar Nov 06 '20 22:11 yuangu-google

I don't think this particular solution (providing an alternate dispatcher for a certain subset of the jobs performed by this component) will cause us much trouble. In fact I think it will be much better than what we currently have, as we'll have introduced proper structured concurrency, making it easy to write tests against this component and control their coroutines behavior accordingingly.

jblebrun avatar Nov 06 '20 23:11 jblebrun