title: How best to wait until the actor stops in kotlinx.coroutines 0.20?
body: <p>In kotlinx.coroutines 0.19, <code>actor</code> returns <code>ActorJob</code> which can be <code>join</code>ed: </p>
  
  <pre><code>val myActor = actor&lt;...&gt; { ... }
  ...
  myActor.join()
  </code></pre>
  
  <p>In 0.20, it's changed to return <code>SendChannel</code>. Looking at the implementation, it does still return an instance of a class which extends <code>Job</code>, so I <em>could</em> write</p>
  
  <pre><code>...
  (myActor as Job).join()
  </code></pre>
  
  <p>but this is an obvious code smell. Is there a better alternative?</p>