Discussion:
NotifyingFuture vs Deferred
(too old to reply)
"이희승 (Trustin Lee)"
2010-10-21 08:48:19 UTC
Permalink
Deferred is not different from NotifyingFuture fundamentally. The only
difference is how it handles an exceptional case and callbacks can
return another Deffered, which makes chained asynchronous operations
possible.

This difference opens a lot of possibilities for performing a series of
asynchronous operations. It can be compared to dynamic construction of
interceptor chains.

So, I'd like to propose to replacing the current NotifyingFuture
implementation with Deferred. I think the name 'Deferred' is somewhat
less intuitive, so retaining the name might be a good idea.

If you are not familiar with Deferreds, check this out:

http://twistedmatrix.com/documents/current/core/howto/deferredindepth.html
--
Trustin Lee - http://gleamynode.net/


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 290 bytes
Desc: OpenPGP digital signature
Url : http://lists.jboss.org/pipermail/infinispan-dev/attachments/20101021/fe7885fc/attachment.bin
Galder Zamarreño
2010-10-22 15:11:03 UTC
Permalink
Post by "이희승 (Trustin Lee)"
Deferred is not different from NotifyingFuture fundamentally. The only
difference is how it handles an exceptional case and callbacks can
return another Deffered, which makes chained asynchronous operations
possible.
This difference opens a lot of possibilities for performing a series of
asynchronous operations. It can be compared to dynamic construction of
interceptor chains.
So, I'd like to propose to replacing the current NotifyingFuture
implementation with Deferred. I think the name 'Deferred' is somewhat
less intuitive, so retaining the name might be a good idea.
http://twistedmatrix.com/documents/current/core/howto/deferredindepth.html
Just couple of weeks ago I was trying to make some sense of twisted and I gave up, particularly when I started to try to understand this deferred stuff and that tutorial is anything but a tutorial IMO.

For example, why doesn't the following get printed?

print "\n-------------------------------------------------\n"

Anyway, I need to get a better understand of deferred before I can decide whether deferred should be implemented or not.
Post by "이희승 (Trustin Lee)"
--
Trustin Lee - http://gleamynode.net/
_______________________________________________
infinispan-dev mailing list
infinispan-dev at lists.jboss.org
https://lists.jboss.org/mailman/listinfo/infinispan-dev
--
Galder Zamarre?o
Sr. Software Engineer
Infinispan, JBoss Cache
Mircea Markus
2010-10-22 17:22:58 UTC
Permalink
Post by Galder Zamarreño
Post by "이희승 (Trustin Lee)"
Deferred is not different from NotifyingFuture fundamentally. The only
difference is how it handles an exceptional case and callbacks can
return another Deffered, which makes chained asynchronous operations
possible.
This difference opens a lot of possibilities for performing a series of
asynchronous operations. It can be compared to dynamic construction of
interceptor chains.
So, I'd like to propose to replacing the current NotifyingFuture
implementation with Deferred. I think the name 'Deferred' is somewhat
less intuitive, so retaining the name might be a good idea.
http://twistedmatrix.com/documents/current/core/howto/deferredindepth.html
Just couple of weeks ago I was trying to make some sense of twisted and I gave up, particularly when I started to try to understand this deferred stuff and that tutorial is anything but a tutorial IMO.
+1.
Post by Galder Zamarreño
For example, why doesn't the following get printed?
print "\n-------------------------------------------------\n"
Anyway, I need to get a better understand of deferred before I can decide whether deferred should be implemented or not.
Post by "이희승 (Trustin Lee)"
--
Trustin Lee - http://gleamynode.net/
_______________________________________________
infinispan-dev mailing list
infinispan-dev at lists.jboss.org
https://lists.jboss.org/mailman/listinfo/infinispan-dev
--
Galder Zamarre?o
Sr. Software Engineer
Infinispan, JBoss Cache
_______________________________________________
infinispan-dev mailing list
infinispan-dev at lists.jboss.org
https://lists.jboss.org/mailman/listinfo/infinispan-dev
Mircea Markus
2010-10-22 17:22:11 UTC
Permalink
Post by "이희승 (Trustin Lee)"
Deferred is not different from NotifyingFuture fundamentally. The only
difference is how it handles an exceptional case and callbacks can
return another Deffered, which makes chained asynchronous operations
possible.
This difference opens a lot of possibilities for performing a series of
asynchronous operations. It can be compared to dynamic construction of
interceptor chains.
Can't you chain the async ops right now by doing async calls in an FutureListener?
I'd be curious to see how API would look for this.
Post by "이희승 (Trustin Lee)"
So, I'd like to propose to replacing the current NotifyingFuture
implementation with Deferred. I think the name 'Deferred' is somewhat
less intuitive, so retaining the name might be a good idea.
http://twistedmatrix.com/documents/current/core/howto/deferredindepth.html
--
Trustin Lee - http://gleamynode.net/
_______________________________________________
infinispan-dev mailing list
infinispan-dev at lists.jboss.org
https://lists.jboss.org/mailman/listinfo/infinispan-dev
Manik Surtani
2010-10-25 11:04:13 UTC
Permalink
So you're suggesting adding exception handling to NotifyingFuture? :)
Post by "이희승 (Trustin Lee)"
Deferred is not different from NotifyingFuture fundamentally. The only
difference is how it handles an exceptional case and callbacks can
return another Deffered, which makes chained asynchronous operations
possible.
This difference opens a lot of possibilities for performing a series of
asynchronous operations. It can be compared to dynamic construction of
interceptor chains.
So, I'd like to propose to replacing the current NotifyingFuture
implementation with Deferred. I think the name 'Deferred' is somewhat
less intuitive, so retaining the name might be a good idea.
http://twistedmatrix.com/documents/current/core/howto/deferredindepth.html
--
Trustin Lee - http://gleamynode.net/
_______________________________________________
infinispan-dev mailing list
infinispan-dev at lists.jboss.org
https://lists.jboss.org/mailman/listinfo/infinispan-dev
--
Manik Surtani
manik at jboss.org
Lead, Infinispan
Lead, JBoss Cache
http://www.infinispan.org
http://www.jbosscache.org

Loading...