Coroutines Job Flashcards

1
Q

What is Job in coroutines?

A

It is a handle to a coroutine. For every coroutine that is created by launch and async, it returns a job instance that uniquely identifies the coroutine and manages the lifecycle.
A job can also be passed in coroutinescope to keep a handle on its lifecycle.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are states of coroutine job?

A

A job can go through a set of states i.e. New, Active, Completing, Completed, Cancelling and Cancelled.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly