Closed
Description
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.