Prism is the first camera package I've seen take Swift 6.2 strict concurrency seriously rather than papering over it with @unchecked Sendable, so I want to ask about the hard part.
AVCaptureSession wants its configuration mutations serialized, and startRunning() blocks the calling thread for a noticeable amount of time. Inside an actor that's awkward - if the actor's executor is doing the blocking call, everything else queued behind it stalls. Are you hopping to a dedicated session queue from inside the actor, or giving the actor a custom executor backed by that queue?
Second, the preview layer has to be touched on the main actor while frames arrive on a capture queue. How are you moving buffers across that boundary without either copying or lying to the compiler about Sendable?
Genuinely interested - this is the exact seam I keep getting wrong.
Prism is the first camera package I've seen take Swift 6.2 strict concurrency seriously rather than papering over it with
@unchecked Sendable, so I want to ask about the hard part.AVCaptureSessionwants its configuration mutations serialized, andstartRunning()blocks the calling thread for a noticeable amount of time. Inside an actor that's awkward - if the actor's executor is doing the blocking call, everything else queued behind it stalls. Are you hopping to a dedicated session queue from inside the actor, or giving the actor a custom executor backed by that queue?Second, the preview layer has to be touched on the main actor while frames arrive on a capture queue. How are you moving buffers across that boundary without either copying or lying to the compiler about Sendable?
Genuinely interested - this is the exact seam I keep getting wrong.