Are long-running Room queries cancellable?


Room (room-ktx) supports Kotlin coroutines since version 2.1.0 out of the box. But I wonder whether long-running database queries are cancellable.

I want to query the database on every entered character to narrow the search result. Each query is executed async in a coroutine, so it could happen that the next query is executed while the previous query is still executed. This previous query should then be cancelled as soon as possible. And this is the critical point: since cancellation is cooperative, Room has to check for cancellation and the question is, how this is implemented.

Are long-running Room queries cancelable within a narrow time frame?