$f1 on_ready [list apply {{name future} {set $name [$future get]}} "[namespace current]::ready_args" ]
-$f1 retain
-
-$f1 await_ready
-
set my_host [exec hostname]
-is [$f1 get] $my_host "hostname retuend ok via get"
-
-$f1 free
+is [$f1 await_get] $my_host "hostname returned ok via get"
is $ready_args $my_host "hostname returned ok via on_ready"
vwait "${selfns}::is_ready"
}
+ method await_get {} {
+ $self retain
+ $self await_ready
+ if [$self is_failure] {
+ set err [$self failure]
+ $self free
+ error $err
+ }
+ set res [$self get]
+ $self free
+ return $res
+ }
+
method retain {} {
incr retain_count
}