{"library":"synchronicity","code":"import asyncio\nfrom synchronicity import Synchronizer\n\nsynchronizer = Synchronizer()\n\n@synchronizer.wrap\nasync def my_async_function(x):\n    await asyncio.sleep(0.1)\n    return x**2\n\n# --- Synchronous usage (blocking) ---\nprint(f\"Synchronous call: my_async_function(5) = {my_async_function(5)}\") # Blocks until result is ready\n\n# --- Asynchronous usage (non-blocking) ---\nasync def main_async():\n    print(f\"Asynchronous call (awaiting): await my_async_function.aio(10) = {await my_async_function.aio(10)}\")\n\n    # Example with multiple concurrent calls from an async context\n    results = await asyncio.gather(\n        my_async_function.aio(2),\n        my_async_function.aio(3),\n        my_async_function.aio(4)\n    )\n    print(f\"Concurrent async calls: {results}\")\n\nasyncio.run(main_async())","lang":"python","description":"This quickstart demonstrates how to define an asynchronous function and then use `Synchronizer` to expose both a synchronous (blocking) interface and an asynchronous (`.aio`) interface for it. The synchronous call blocks until completion, while the asynchronous call can be awaited within an async context.","tag":null,"tag_description":null,"last_tested":"2026-04-24","results":[{"runtime":"python:3.10-alpine","exit_code":0},{"runtime":"python:3.10-slim","exit_code":0},{"runtime":"python:3.11-alpine","exit_code":0},{"runtime":"python:3.11-slim","exit_code":0},{"runtime":"python:3.12-alpine","exit_code":0},{"runtime":"python:3.12-slim","exit_code":0},{"runtime":"python:3.13-alpine","exit_code":0},{"runtime":"python:3.13-slim","exit_code":0},{"runtime":"python:3.9-alpine","exit_code":0},{"runtime":"python:3.9-slim","exit_code":0}]}