Skip to content

Make arg-reference #22

@s3rius

Description

@s3rius

This issue comes from the discussion https://github.com/orgs/taskiq-python/discussions/233.

Initial idea is to create a class that can reference arguments of the current function.

async def dependency(sleep_time: float) -> float:
    await asyncio.sleep(sleep_time)
    return sleep_time

async def target(arg: float, sleept: float = TaskiqDepends(dependency, kwargs={"sleep_time": ArgRef("arg")})):
    print(f"short_sleep: {sleept}")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions