Skip to content

Add suport for standby Actors #973

Description

@Pijukatel

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request.t-toolingIssues with this label are in the ownership of the tooling team.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions