-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
V2 - finally! #123
V2 - finally! #123
Conversation
Oh, one more notable breaking change: Haxe 3 is no longer supported ^^ |
At first it is quite hard to understand what "suspendable" means, by just looking at the code. But after your explanation I understood it and found it really nice. I am happy to have it as default. Also we should document it. |
btw will we deprecate |
Don't use tink.CoreApi inside tink.core itself (related to #119)
Hmm, we could, but TBH I never quite understood why OTOH, if you're suggesting that having a different name might reduce confusion, I'd say that's a thought worth exploring :) |
I don't know too. But now i can see composition is better. |
Ok, let's do this! |
Wow I had miss this was already released! |
So, uhm ... here we are. The 2nd attempt. Mostly just deprecation, with the following:
Breaking changes
new Future()
andnew Signal()
both lead to suspendable signals/futures. I guess nobody relied on those, so we should be finenew Promise
expects the initializer to return aCallbackLink
. Might upset JS people, but I really would prefer for things to be authored in a suspendable manner. Should haxe ever get overloading/partial functions/optional returns, I'd be fine with supporting non-suspendable initializers.SignalObject
andFutureObject
are private. This is to guarantee certain invariants. This happened to caused an edge case in tink_lang (resolved on HEAD), but I doubt anybody will be affected.Future<Array<T>> @:from Array<Future<T>>
cast is gone, as isCallback<T> @:from Callback<Noise>
Deprecations
Future.async
is fully deprecated (but behaves as before in respect to lazyness), in favor ofFuture.irreversible
and the more preferablenew Future
. Before my idea was to flip the behavior to default to lazy, but that seems like it's inviting a lot of trouble.CallbackLink::dissolve
is deprecated in favor ofCallbackLink::cancel
.Future.ofMany
is deprecated in favor ofFuture.inSequence
.>>
for futuresStatus
Tests pass (as tink_testrunner itself makes strong use of tink_core, that's a rather good sign). I also dropped this into MVCoconut/examples-todomvc and it works without issues. So all in all, it should be fine to use. You can expect quite a few deprecation warnings popping up in
Notable Additions
Lazy
var computed(get, never):Bool
to check if a lazy is already computedLazy
against stackoverflow ... will not work if you nestLazy.ofFunc
indefinitely, but for nested.map
/.flatMap
it will doFuture
inParallel
/inSequence
to matchPromise
var status(get, never):FutureStatus<T>
which tells you a future's status. The most notable one isReady(result:Lazy<T>)
which allows processing sync (or resolved) futures in a sync manner. This should allow speeding things up in tink_streams (e.g. Recursiveness and php tink_streams#20)Signal
SignalTrigger
can now be destroyedIn any case, please let me know what you think and if you get any other regressions from this. I would like to merge this sooner rather than later, because it enables a few improvements in dependent libs.