rust-async-patterns
비동기 Rust 패턴 빠르게 배우기
비동기 Rust는 구조화하고 디버깅하기 어려울 수 있습니다. 이 스킬은 Tokio 태스크, 채널, 스트림, 에러 처리에 대한 명확한 패턴을 제공합니다.
스킬 ZIP 다운로드
Claude에서 업로드
설정 → 기능 → 스킬 → 스킬 업로드로 이동
토글을 켜고 사용 시작
테스트해 보기
"rust-async-patterns" 사용 중입니다. Explain how to limit concurrency for async HTTP requests in Tokio.
예상 결과:
- URL에 대한 스트림을 사용하고 제한과 함께 buffer_unordered를 적용
- 결과를 수집하고 요청별로 에러 처리
- 메모리와 소켓을 보호하기 위해 무제한 스포닝 방지
"rust-async-patterns" 사용 중입니다. Show me how to coordinate between async tasks using channels.
예상 결과:
- 프로듀서와 컨슈머 간 일대일 통신에는 mpsc::channel 사용
- 여러 컨슈머가 동일한 메시지를 받아야 할 때는 broadcast::channel 사용
- 스폰된 태스크로부터 단일 응답이 필요할 때는 oneshot::channel 사용
"rust-async-patterns" 사용 중입니다. How do I handle errors in async Rust code properly?
예상 결과:
- 컨텍스트 체이닝이 있는 애플리케이션 레벨 에러에는 anyhow 사용
- 커스텀 에러 타입을 만드는 라이브러리 코드에는 thiserror 사용
- 무기한 대기를 방지하기 위해 작업을 timeout으로 래핑
보안 감사
안전Pure educational documentation containing Rust async programming examples. All static findings are false positives: 'process spawn' refers to tokio::spawn for async task management (not command execution), 'backtick execution' refers to markdown code formatting, and 'weak cryptographic algorithm' refers to keywords in documentation fields. The skill contains no tool definitions, file access, network calls, or command execution capabilities.
위험 요인
⚙️ 외부 명령어 (39)
품질 점수
만들 수 있는 것
동시성 서비스 구축
비동기 Rust 서비스에서 태스크 오케스트레이션, 에러 처리, 셧다운을 위한 구조화된 패턴을 적용합니다.
비동기 데드락 디버깅
트레이싱 가이드와 일반적인 함정을 활용하여 멈춘 태스크와 락 오용을 진단합니다.
비동기 개념 학습
짧고 집중된 예제로 futures, await, 스트림, 채널을 학습합니다.
이 프롬프트를 사용해 보세요
Give a short Tokio async main example with tracing and a simulated async call. Explain each step in one sentence.
Show a pattern for limiting concurrent async tasks for a list of URLs using Tokio or futures streams.
Explain a graceful shutdown approach using CancellationToken and a shutdown broadcast channel.
Provide an async trait design for a repository with get, save, and delete, and note trait object usage.
모범 사례
- futures를 안전하게 경쟁시키려면 tokio::select! 사용
- 공유 가변 상태보다 조정을 위한 채널 선호
- 관측성을 위해 비동기 태스크에 tracing 적용
피하기
- 비동기 코드에서 std::thread::sleep 같은 블로킹 함수 호출
- await 포인트를 넘어 mutex나 rwlock 가드 유지
- 동시성 제한 없이 무제한 태스크 스포닝
자주 묻는 질문
현재 Tokio 버전과 호환되나요?
전체 애플리케이션 코드를 생성하나요?
기존 리포지토리에서 사용할 수 있나요?
내 데이터에 접근하거나 저장하나요?
비동기 코드가 여전히 멈추면 어떻게 하나요?
일반적인 비동기 가이드와 어떻게 다른가요?
개발자 세부 정보
작성자
wshobson라이선스
MIT
리포지토리
https://github.com/wshobson/agents/tree/main/plugins/systems-programming/skills/rust-async-patterns참조
main
파일 구조
📄 SKILL.md