File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed
Sources/DataLoader/Channel Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change 1
- public actor Channel < Success: Sendable , Failure: Error > : Sendable {
1
+ internal actor Channel < Success: Sendable , Failure: Error > : Sendable {
2
2
private var state = State < Success , Failure > ( )
3
3
}
4
4
5
- public extension Channel {
5
+ internal extension Channel {
6
6
@discardableResult
7
7
func fulfill( _ value: Success ) async -> Bool {
8
8
if await state. result == nil {
Original file line number Diff line number Diff line change @@ -19,6 +19,9 @@ actor Concurrent<T> {
19
19
}
20
20
21
21
/// Primary API
22
+ ///The `try await Task.sleep(nanoseconds: 2_000_000)` introduces a small delay to simulate asynchronous
23
+ ///behavior and ensure that concurrent requests (`value1`, `value2`...) are grouped into a single batch
24
+ ///for processing, as intended by the batching settings.
22
25
final class DataLoaderTests : XCTestCase {
23
26
/// Builds a really really simple data loader'
24
27
func testReallyReallySimpleDataLoader( ) async throws {
You can’t perform that action at this time.
0 commit comments