Skip to content

Timeouts in default mid-level functions #60

Open
@johny-b

Description

@johny-b

My golem_core-based code usually has this:

from golem_core.mid import default_negotiate

async def negotiate(proposal):
    return await asyncio.wait_for(default_negotiate(proposal), timeout=5)

(and the same for other default_* functions).

--> It seems timeouts should be inside the golem-core, somewhere. Note that we can't just add an argument to default_negotiate, because it is intended to be called via Map in a Chain so we don't control the arguments that easily.

I see two options here:
A) Default timeouts in default_* functions that are fixed (or maybe can be changed with things like golem_core.mid.DEFAULT_NEGOTIATE_TIMEOUT = 7?)
B) Timeout argument to Map

I'm not sure which is better, maybe there's a third path?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions