Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lazy actor is not terminated on close #939

Closed
qwwdfsad opened this issue Jan 16, 2019 · 0 comments · May be fixed by softagram/kotlinx.coroutines#6
Closed

Lazy actor is not terminated on close #939

qwwdfsad opened this issue Jan 16, 2019 · 0 comments · May be fixed by softagram/kotlinx.coroutines#6
Assignees
Labels

Comments

@qwwdfsad
Copy link
Contributor

Reproducer:

val job = launch {
  val actor = actor<Int>(start = CoroutineStart.LAZY) {}
  actor.close()
}

job.join()
@qwwdfsad qwwdfsad added the bug label Jan 16, 2019
@qwwdfsad qwwdfsad self-assigned this Jan 16, 2019
qwwdfsad added a commit that referenced this issue Jan 17, 2019
Rationale:
While it is possible to atomically transition state machine to "completed", it has multiple caveats:
  * It breaks intuition that "close" allows actors to process remaining messages and call its body
  * It introduces one more internal API dependency
  * It makes behaviour of non-lazy and lazy actors inconsistent

Fixes #939
elizarov pushed a commit that referenced this issue Feb 6, 2019
Rationale:
While it is possible to atomically transition state machine to "completed", it has multiple caveats:
  * It breaks intuition that "close" allows actors to process remaining messages and call its body
  * It introduces one more internal API dependency
  * It makes behaviour of non-lazy and lazy actors inconsistent

Fixes #939
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant