This will unsubscribe from the Future, but won't suspend it :(
import tink.core.Future;
function main() {
var future = new Future(yield -> {
trace("start");
var timer = haxe.Timer.delay(() -> yield("done"), 1000);
() -> { trace("stop"); timer.stop(); }
});
var link = future.handle(s -> trace(s));
// haxe.Timer.delay(link.cancel, 500);
link.cancel();
}
Quick debugging suggests that it's the CallbackList.release method doesn't check if the list is drained unless it's time to compact. Am I doing wrong assumption about when the future is suspended or is this a bug?
This will unsubscribe from the Future, but won't suspend it :(
Quick debugging suggests that it's the
CallbackList.release
method doesn't check if the list is drained unless it's time to compact. Am I doing wrong assumption about when the future is suspended or is this a bug?