Currently, neither the API nor the client supports standby Actors. Users are forced to do manual HTTP requests.
Create a helper method for calling a standby actors.
Open questions:
- What is the input? Just the actor id, payload, method and path? Or a request object?
- In theory, an actor can be both standby and direct run... Do we need to distinguish it?
- Separate new call method or new argument to
ActorClient.call / ActorClient.start
Current workflow could be turned into a convenience function
client = ApifyClientAsync(...)
standby_actor = await client.actor(standby_actor_id).get()
standby_url = actor.standby_url
path="something"
call_url = f"{standby_url}/{path}"
headers = {"Authorization": f"Bearer {Actor.configuration.token}"}
async with httpx.AsyncClient() as http_client:
response = await http_client.get(call_url, headers=headers)
response.raise_for_status()
received = response.json()
Sync the issue with the latest development in the channel https://apify.slack.com/archives/C09JK2NUG57/p1784710989775289
Currently, neither the API nor the client supports standby
Actors. Users are forced to do manual HTTP requests.Create a helper method for calling a standby actors.
Open questions:
ActorClient.call/ActorClient.startCurrent workflow could be turned into a convenience function
Sync the issue with the latest development in the channel https://apify.slack.com/archives/C09JK2NUG57/p1784710989775289