Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-15]
os: [macos-26]

steps:
- uses: actions/checkout@v4

- name: Select Xcode
run: sudo xcode-select -s /Applications/Xcode_26.3.app
run: sudo xcode-select -s /Applications/Xcode_26.5.app

- name: Show Swift version
run: swift --version
Expand Down
15 changes: 8 additions & 7 deletions Sources/EffectView/EffectObservable/EffectObservable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public final class EffectObservable<
internal(set) public var state: State

@ObservationIgnored
private var send: Send?
private var runtimeSend: Send?
@ObservationIgnored
nonisolated(unsafe) private var runtimeUnavailable: RuntimeUnavailable?
@ObservationIgnored
Expand Down Expand Up @@ -71,11 +71,11 @@ public final class EffectObservable<
env: env
)
self._input = Input(self)
self.send = send
self.runtimeSend = send
if let event = initialEvent {
Task {
do {
try await send(event, input: _input, continuation: nil)
try await send(event, input: _input)
} catch {
print("could not process initial event: \(error)")
// TODO: consider sending a control event
Expand All @@ -84,6 +84,7 @@ public final class EffectObservable<
}
}

@_optimize(none) // https://github.com/swiftlang/swift/issues/82523
isolated deinit {
cancel()
}
Expand Down Expand Up @@ -117,11 +118,11 @@ public final class EffectObservable<
/// critical failure, or `CancellationError` if accepted work is later cancelled.
public func send(_ event: Event) async throws {
try checkRuntimeAvailability()
guard let send = send else {
guard let send = runtimeSend else {
throw RuntimeUnavailable.actorCancelled
}
do {
try await send(event, input: _input, continuation: nil)
try await send(event, input: _input)
} catch {
let boundaryError = runtimeBoundaryError(for: error)
if let runtimeUnavailable = boundaryError as? RuntimeUnavailable {
Expand Down Expand Up @@ -184,7 +185,7 @@ public final class EffectObservable<
// TODO: consider to to add a Task cancellation handler which sends a corresponding control event to the transducer.
// The transducer's action on this is currently "implementation defined". It *could* have no effect on the task operation, or it *could* cancel it.
try checkRuntimeAvailability()
guard let send = self.send, let input = _input else {
guard let send = self.runtimeSend, let input = _input else {
throw RuntimeUnavailable.actorCancelled
}
return try await withCheckedThrowingContinuation { (continuation: Continuation<Output>) in
Expand Down Expand Up @@ -246,7 +247,7 @@ public final class EffectObservable<

runtimeUnavailable = .actorCancelled

guard let send else {
guard let send = runtimeSend else {
return
}

Expand Down
Loading