From 8913f827ffeebf94ab3b37754c010fccc42e48bb Mon Sep 17 00:00:00 2001 From: Christien Rioux Date: Tue, 1 Aug 2023 00:40:11 -0400 Subject: [PATCH] doc --- veilid-flutter/example/pubspec.lock | 2 +- veilid-tools/src/eventual.rs | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/veilid-flutter/example/pubspec.lock b/veilid-flutter/example/pubspec.lock index b121351f..da827445 100644 --- a/veilid-flutter/example/pubspec.lock +++ b/veilid-flutter/example/pubspec.lock @@ -403,7 +403,7 @@ packages: path: ".." relative: true source: path - version: "0.1.6" + version: "0.1.7" win32: dependency: transitive description: diff --git a/veilid-tools/src/eventual.rs b/veilid-tools/src/eventual.rs index 9ad0f6c0..a0a49a47 100644 --- a/veilid-tools/src/eventual.rs +++ b/veilid-tools/src/eventual.rs @@ -1,3 +1,10 @@ +/// Eventual is like Dart's "Completer" +/// It is a thread-safe concurrent data future that may eventually resolve to a value +/// Three variants exist +/// Eventual, which will complete each 'instance' future to that instance's value (can be different per instance) only when 'resolve' is called. +/// EventualValue, which will complete each 'instance' future when 'resolve' is called with an owned value, and one of those instances may 'take' the value. +/// EventualValueClone, which will complete each 'instance' future when 'resolve' is called with a Clone-able value, and any of those instances may get a clone of that value. +/// The future returned from an Eventual::resolve() can also be awaited on to wait until all instances have been completed use super::*; use eventual_base::*;