tag:blogger.com,1999:blog-6373963829340632529.post6433484729057983089..comments2024-01-30T05:40:30.415-03:00Comments on Algorithmically challenged: In hindsight, maybe I should have used Actors...Danielhttp://www.blogger.com/profile/07505997833685327219noreply@blogger.comBlogger7125tag:blogger.com,1999:blog-6373963829340632529.post-86104593963009992132012-11-08T16:00:22.538-02:002012-11-08T16:00:22.538-02:00@Irfan
I've pondered many times during the de...@Irfan<br /><br />I've pondered many times during the development whether I shouldn't go to an iteratee-based solution, but I couldn't visualize how to handle the concurrency requirements with iteratees.<br />Danielhttps://www.blogger.com/profile/07505997833685327219noreply@blogger.comtag:blogger.com,1999:blog-6373963829340632529.post-46497502241854322772012-11-08T15:48:55.583-02:002012-11-08T15:48:55.583-02:00Thanks for sharing your experience.
What are your...Thanks for sharing your experience.<br /><br />What are your thoughts on the applicability of reactive streams (enumerators/enumeratees) and stream interleaving, etc in Play! Framework 2 to these problems?<br />Irfan Ahmadhttp://www.cloudphysics.comnoreply@blogger.comtag:blogger.com,1999:blog-6373963829340632529.post-65795067628745338152012-10-12T19:32:45.552-03:002012-10-12T19:32:45.552-03:00On the one thing you like better on Dispatch's...On the one thing you like better on Dispatch's Promise over Scala's Future, will you get that feedback to Scala so that it has a chance to improve post 2.10? Thanks much, Daniel, for sharing in detail your experience and thinking.<br />Best,<br />JonJonhttps://www.blogger.com/profile/10372924550798697525noreply@blogger.comtag:blogger.com,1999:blog-6373963829340632529.post-63294786949080823502012-10-10T13:47:39.556-03:002012-10-10T13:47:39.556-03:00Hi, Alex. My current thinking on what would have b...Hi, Alex. My current thinking on what would have been the best solution to the final requisites is a mixed approach. A net of actors comprised of "source" actors, which control which files to download and when, plus a single downloader actor which would throttle the number of concurrent downloads. The downloads would be Dispatch Promises, which would send a response message at the end of its processing, but, otherwise, would be left to java.nio onSuccess/onFailure thread pool (behind the scenes -- Dispatch abstracts that away).<br /><br />There's another type of actor that would be responsible for notifying the other system modules. It's present implementation suffices, but it is unsophisticated. In an actor system, a main actor would spawn other actors to notify specific modules, and maybe also send them the notification batches. That would allow a fine control on how to handle problems notifying other modules.<br /><br />The key here is that I originally had a single source, and, by the end, had over 30 distinct sources with varying degrees of interdependency, and could well have used an even finer grained way of identifying files to download and scheduling them (the problem is really just a matter of prioritizing -- downloading everything that's been update is straightforward).<br />Danielhttps://www.blogger.com/profile/07505997833685327219noreply@blogger.comtag:blogger.com,1999:blog-6373963829340632529.post-48884280514217254362012-10-10T02:32:50.060-03:002012-10-10T02:32:50.060-03:00Great article Daniel, enjoyed the read. I had a s...Great article Daniel, enjoyed the read. I had a similar situation where we went with actors and I was wondering whether futures would result in code that is more straight-forward and easier to test. I would be curious to hear what your thoughts are on that. For us batching was definitely a factor, and turned out nice to implement via actors. I'm also curious whether a mixed approach would work as well (perhaps an actor at the lower that could return a future via 'ask' to the higher level code). Alex Kirahttp://twitter.com/AlexKiranoreply@blogger.comtag:blogger.com,1999:blog-6373963829340632529.post-47622031205411181342012-10-09T15:46:06.443-03:002012-10-09T15:46:06.443-03:00That's really well written and full of useful ...That's really well written and full of useful insights and ideas. I also like your level-headed look at Scala: "there are some things that would be nice, but you know what, in the grand scheme of things, it's all right". In light of the favourite Ruby / RoR bashing, I appreciate your point that the project may have gone just as well in Ruby. It's just a shame that no-one will ever know.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-6373963829340632529.post-27721292282556077382012-10-08T23:27:58.863-03:002012-10-08T23:27:58.863-03:00Thanks Daniel for your kind words and I'm glad...Thanks Daniel for your kind words and I'm glad that specs2 helped!Erichttps://www.blogger.com/profile/16484514586929815703noreply@blogger.com