AsyncObjects
AsyncObjects copied to clipboard
Refactor `Future` into protocol(s) to allow restricting fulfillment
Currently Future is an all in one that allows interrogating results and fulfilling the future as well. This disallows restricting fulfillment by consumers.
Refactoring Future into a protocol that only allows interrogation and a sub-protocol, FulfillableFuture, that adds fulfillment capabilities would allow choosing which capabilities to expose to consumers.
The current Future implementation would need to be renamed (e.g. AsyncFuture or StdFuture) and would simply implement both protocols.