Loading...
Loading...
This skill provides async/await patterns and best practices for concurrent programming
npx skill4agent add ingpoc/skills async-programming-skill# WRONG
with open(file) as f:
data = json.load(f)
# CORRECT
async with aiofiles.open(file) as f:
data = await f.read()try:
result = await asyncio.wait_for(operation(), timeout=30.0)
except asyncio.TimeoutError:
# Handle timeoutasync def safe_operation():
try:
return await risky_operation()
except Exception as e:
logger.error(f"Operation failed: {e}")
raise TradingError(...) from e