-
Notifications
You must be signed in to change notification settings - Fork 14
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Proposal
Add native asynchronous (async/await) support to the Jamf Pro SDK, enabling use with modern async Python frameworks.
Features:
- Async client classes:
AsyncJamfProClient,AsyncProApi,AsyncClassicApi,AsyncJCDS2, andAsyncWebhooksClient - Async pagination & concurrency operations
- Context manager support
Backwards compatibility is ensured as we would not be modifying existing synchronous code whatsoever.
Implementation Example
import asyncio
from jamf_pro_sdk import AsyncJamfProClient, ApiClientCredentialsProvider
async def main():
async with AsyncJamfProClient(
server="jamf.my.org",
credentials=ApiClientCredentialsProvider("client_id", "client_secret")
) as client:
# Single async operation
computers = await client.classic_api.list_all_computers()
# Concurrent operations
computer_ids = [c.id for c in computers]
async for computer in client.async_concurrent_api_requests(
handler=client.classic_api.get_computer_by_id,
arguments=computer_ids
):
print(f"{computer.general.name}")
asyncio.run(main())Note
To support both sync and async operations, the SDK would use httpx instead of requests. However, httpx was built to be a viable replacement for requests.
Additional Details
This is a follow up to this slack convo. Happy to provide additional details/examples as needed!
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request