Skip to content

Named service support #2352

Closed
Closed
@astavonin

Description

@astavonin

We can come up with a public API to create global, singleton tasks, possibly with the following signatures:

   unsafe fn register_named_service<T>(n: str, f: fn~(port<T>))
   unsafe fn get_named_service<T>(n: str) -> chan<T>

This would, if the named service doesn't exist, create a new task and execute the specified function. You would use this in each test to create or retrieve a global service to manage your state. The big reservation I have about this is that we can not currently make this interface type safe - we can't even check the types at runtime.

Description was copied from mail-list.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-enhancementCategory: An issue proposing an enhancement or a PR with one.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions