On 10 October 2012 18:56, Jan Willem Janssen <janwillem.jans...@luminis.eu> wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hi, > > I've been familiarizing myself with the Shindig SPI for a while now > and keep wondering about the use of Future's for the results of most > of the SPI interfaces. > What strikes me most is that an SPI-implementation has to think about > the possible asynchronous nature of its method calls (which, as it > currently boils down, is never used in the current codebase). Aside > that, it makes all the supporting code of the SPI very complex and > hard to debug. > > Anybody care to elaborate about the rationale behind this?
I will have a go since I was involved in the early SPI. Many of the calls in a real Social network impl are remote or over links that may have IO waits. If you use Futures you can dispatch them at the start of the request and collect them all at the end of the request hence interleaving IO time more effectively. Obviously that assumes you SPI impl is capable of being event driven. If you dont want to do this, then you can use immediate futures to ensure everything is processes as a simple sequential process. I think that still holds true today, even if no one is using them now. HTH Ian > > - -- > Met vriendelijke groeten | Kind regards > > Jan Willem Janssen | Software Architect > +31 631 765 814 > > /My world is:/ > > Luminis Technologies B.V. > IJsselburcht 3 > 6825 BS Arnhem > +31 88 586 46 30 > > http://www.luminis-technologies.com > http://www.luminis.eu > > KvK (CoC) 09 16 28 93 > BTW (VAT) NL8169.78.566.B.01 > -----BEGIN PGP SIGNATURE----- > Version: GnuPG/MacGPG2 v2.0.17 (Darwin) > Comment: GPGTools - http://gpgtools.org > Comment: Using GnuPG with Mozilla - http://www.enigmail.net/ > > iQIcBAEBAgAGBQJQdSooAAoJEKF/mP2eHDc4BHUP/3azQPhqjdSQq01LjKG4K1vc > Wi0gEoisR2/OUclkzNynnX7woP02J3S/Ct8XRe6kBp/rQOAEi2LPsmN3n0WJVlDI > 6yIbEyrVeJQorvyEFAtXM4o3pz/pp03bLoo8URi1v7/79I6UoTckQpWk5vECFzVU > Kq2wq5glpsiRCDdAE7LmI7RQDny1h5L0Lek56lInGNltT4fm3JLsPBm2KUPSd9ap > CEcWO5wVIYxSzvVzEvHW1/vCv/hWb5ZCp8V0Zh96tRlQJuaO29OFkAGrEEjJrPsz > fTwVoxgkN+JHVzbMhKgW9uPxuV30r1y1Sb9LIbgbdyOwJUCPjuMLtvGOVezrUQmU > IcJ/sgHB7cujXwvBeZnPW71dnBhoBh1tHGUFHVBrBWJcwHH3MoOpDYGYcuGG8ffw > nYP/xRGkHGYHQqEWF2Oo/XWDTh+pSwfftWUeNb8lSiuUbz0ljRiCoQ5HZWmyQQfw > UehNv+YeLZPs87p6GwI4S4gODPhJ8kLasZSS78OrES9PFi86ZCfnDGyk14kHqEdP > XGP0LxoUzvA9QLX4uJA2uJngmBpUKoOisKA0ds6KD0RAIgfG0iTOct6TlUJZDvgE > KbnCmRkVI0YPyrHue2Ay3qZ7wqW5R4zHq7TOdsxTyc/bFMTYDzyMFanfOSGkEQPQ > nrdnaMnYbWZMj/IJhKsY > =121v > -----END PGP SIGNATURE----- >