On Mon, Sep 21, 2009 at 1:19 PM, espeed <james.thorn...@gmail.com> wrote:

> On Sep 21, 2:33 pm, David Pollak <feeder.of.the.be...@gmail.com>
> wrote:
> > Lift only uses event-based Actors for supporting CometActors.  All parts
> of
> > the standard HTTP request/response cycle (except for the CometActors) are
> > handled on a single thread.
> Hi David -
> Thanks for your quick response. If an app developer wants to
> parallelize requests to Web services, what is the recommended way to
> do this in Lift?
> For example, in Rails you might do something like this, where the time
> to gather all the data for the page is limited to the longest request
> instead of the sum of all requests:
> t1 = Thread.new do
>  @news_data = NewsClient.getNewsData()
> end
> t2 = Thread.new do
>  @advertisements = AdsClient.getAdsByLocation(zip)
> end
> t1.join
> t2.join
> Is there a Lift event-based actor API for this or what is the Lift way
> of doing this?

Well.. there's a Java way of doing exactly that: fork/join on a thread.  See

But to weave this into the page rendering, there would be some work required
on your part: forking the threads early in the page render cycle and then
harvesting their results as each snippet is called.

It might be an interesting feature for Lift, however, to allow for the
forking of snippet execution that would be resolved at the end of page
rendering.  I've added a ticket to add this feature to Lift.

> Thanks again.
> James
> >

Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Git some: http://github.com/dpp

You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
For more options, visit this group at 

Reply via email to