openCursor
suspend fun Queryable.openCursor(query: Key? = null, direction: Cursor.Direction = Cursor.Direction.Next, cursorStart: CursorStart? = null, autoContinue: Boolean): Flow<CursorWithValue>
When autoContinue is true
, all values matching the query will emit automatically. It is important not to suspend in flow collection on anything other than flow operators (such as .toList
).
Warning: when autoContinue is false
, callers are responsible for data flow and must call continue
, advance
, or similar explicitly. The returned flow will terminate automatically after continue
if no more elements remain. Otherwise, you must call close
to terminate the flow. Failing to call continue
or close
will result in the flow stalling.
suspend fun Queryable.openCursor(query: Key? = null, direction: Cursor.Direction = Cursor.Direction.Next, cursorStart: CursorStart? = null): Flow<CursorWithValue>
Deprecated
In the future, `autoContinue` will be a required parameter.
Replace with
openCursor(query, direction, cursorStart, autoContinue = true)
Content copied to clipboard