You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> **Gotcha:** don’t pass the **same** subscription/queue manager instance to both the client and a nested session. Keep ownership boundaries clear to avoid event recursion.
95
+
96
+
## Processing mechanisms
97
+
98
+
-**Serial Processing Queue**
99
+
Ordered, single-consumer coroutine pipeline. Backpressure is natural (FIFO).
100
+
```kotlin
101
+
serialQueue.start()
102
+
serialQueue.enqueue { /* work in order */ }
103
+
serialQueue.stop()
104
+
```
105
+
106
+
-**Single-Flight Processor**
107
+
Coalesces concurrent calls with the same key into one in-flight job; callers await the same result.
108
+
109
+
-**Retry Processor**
110
+
Linear/exponential policy with `minRetries`, `maxRetries`, `initialDelayMillis`, optional `maxDelayMillis`, and a `giveUpFunction(attempt, Throwable)`.
111
+
112
+
-**Batcher**
113
+
Collects items into batches based on size and/or debounce window, then flushes on the queue/scope.
114
+
115
+
## Factories & default implementations
116
+
Public interfaces ship with convenience factory functions that return the default internal implementation (e.g., `StreamSerialProcessingQueue(...)` → `StreamSerialProcessingQueueImpl`). Prefer these factories in internal code; they keep call-sites stable while impls evolve. You can also provide custom implementations for testing or specialized behavior.
117
+
118
+
## License
119
+
Copyright (c) 2014-2025 Stream.io Inc.
120
+
121
+
Licensed under the Stream License; see [LICENSE](https://github.com/GetStream/stream-android-base/blob/main/LICENSE).
122
+
Unless required by applicable law or agreed to in writing, software distributed under the License is provided **“as is”**, without warranties or conditions of any kind.
0 commit comments