Skip to content

feat: add sync and async client APIs - #56

Open
ijelacicbot wants to merge 1 commit into
masterfrom
feature/async-sync-clients
Open

feat: add sync and async client APIs#56
ijelacicbot wants to merge 1 commit into
masterfrom
feature/async-sync-clients

Conversation

@ijelacicbot

Copy link
Copy Markdown
Contributor

Summary

  • Add AsyncClient with the same Judge0 operations as the sync Client.
  • Add async flavor clients for Judge0 Cloud, RapidAPI, and AllThingsDev.
  • Allow injecting httpx.Client / httpx.AsyncClient for tests and custom transports.

Same work as #51, opened from judge0/judge0-python so Actions can receive repository secrets. Rebased onto current master (CHANGELOG only).

Motivation

Closes #50

The SDK only had a blocking Client on httpx.Client. Async applications had to wrap calls in a thread pool.

Changes

  • Client accepts optional http_client= and exposes close() / context manager.
  • New AsyncClient with awaited methods and aclose() / async context manager.
  • Flavor counterparts: AsyncJudge0CloudCE, AsyncRapidJudge0CE, AsyncATDJudge0CE, Extra CE variants, and base classes.
  • Offline unit tests use HTTPX MockTransport.
  • Docs and changelog updated. HTTPX2 was not adopted; this stays on httpx.

Test Plan

  • uv run pytest tests/test_async_clients.py
  • uv run ruff check src tests
  • uv run pyright src tests
  • Live client tests on this same-repo PR (JUDGE0_* secrets)

Notes for Reviewers

Existing async_execute / async_run still mean "do not wait for results". They are not asyncio coroutines. This PR adds real asyncio clients.

Fork PR: #51

Expose AsyncClient and flavor-specific async clients with the same
Judge0 operations as the existing sync Client. Allow injecting HTTPX
clients for tests, proxies, and custom transports.

Closes #50
@ijelacicbot
ijelacicbot requested a review from a team August 31, 2026 19:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add sync and async client APIs

1 participant