Skip to content

Commit 36242b7

Browse files
committed
changed: public to internal and added comment about Task sleep in tests
1 parent 49b9d8c commit 36242b7

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

Sources/DataLoader/Channel/Channel.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
public actor Channel<Success: Sendable, Failure: Error>: Sendable {
1+
internal actor Channel<Success: Sendable, Failure: Error>: Sendable {
22
private var state = State<Success, Failure>()
33
}
44

5-
public extension Channel {
5+
internal extension Channel {
66
@discardableResult
77
func fulfill(_ value: Success) async -> Bool {
88
if await state.result == nil {

Tests/DataLoaderTests/DataLoaderTests.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ actor Concurrent<T> {
1919
}
2020

2121
/// 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.
2225
final class DataLoaderTests: XCTestCase {
2326
/// Builds a really really simple data loader'
2427
func testReallyReallySimpleDataLoader() async throws {

0 commit comments

Comments
 (0)