AsyncObjects icon indicating copy to clipboard operation
AsyncObjects copied to clipboard

Refactor `Future` into protocol(s) to allow restricting fulfillment

Open kdubb opened this issue 10 months ago • 0 comments

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.

kdubb avatar Sep 29 '23 22:09 kdubb