4장: Swift Actor 보호 권역 및 격리 전염성 실증
💡 액터 하나를 도입하면, 그 액터와 데이터를 주고받는 모든 타입이 Sendable 증명을 요구받는다.
시나리오 1: 액터 직렬 큐 (상호 배제)
시나리오 2: 격리 전염성 (Contagion)
액터 시동 제어 스테이지
1. 대기열 (Queue)
2. 액터 내부 (Lock)
3. 처리 완료 (Exit)
🔒 Actor
대기 중
git pull 이전 (로컬 빌드 성공)
DataStore
(일반 Class 상태)
NetworkLayer
(내가 짠 코드 · 에러 없음)
UserInterface
(내가 짠 코드 · 에러 없음)
팀 리포지토리 동기화 전
DataStore
(Class 상태)
NetworkLayer
(내 코드)
❌ error: Non-sendable type 'UserRecord' passed across actor boundary; static compilation failed.
UserInterface
(내 코드)
❌ error: MainActor-isolated viewmodel cannot accept non-sendable entity streams from mutated repository.
동시 접근 시뮬레이션 시작
컴파일러 추적 콘솔
> 시스템 대기 중.
인과관계 정밀 분석 리포트
시뮬레이션을 시작하면 동시성 보호 장치의 작동 인과관계가 실시간으로 출력됩니다.