Forum OpenACS Development: Re: Re: ADP include multithreaded execution

Collapse
Posted by Malte Sussdorff on
Hi Gustaf, thanks a lot for your answer but you totally lost me starting with the second sentence 😊. Do you mean I should go in the .tcl page and start individual threads to return the HTML code of each of the includes and then just insert this in the .adp page ?

All overview pages in contacts package and project-manager package are a collection of includes. As an example, the project-manager overview page has 10 includes from which to collect the data.

Collapse
Posted by Gustaf Neumann on
Malte,

if you start simply threads for snippets in a synchronous fashion (e.g. blocking until the result is computed) you gain nothing. One has to dispatch these asynchronously and collect the results, therefore the collector thread.

However, there is as well a much simpler approach to achieve similar results by using multiple connection threads to render a complex page. In general, this could be achieved with iframes, objects with html data, or ajax calls. just for fun, i implemented all three variants based on xowiki. I would think that the solution with background ajax calls is the most useful. It should be at least sufficient for you to get a better estimate whether you want to investigate further.

Update your xowiki from cvs and paste the following content into an xowiki page. You get roughly an output like the following
http://media.wu-wien.ac.at/download/xowiki-doc/view%20mySpace.png
where the portlets (adp includes) are rendered via separate connection threads. This requires some overhead over the sketched internal dispatch, but still, when computing the contents is slow, and you have plenty of processors, it might be better.

If you can split your complex page into multiple adp-includes, you can use these for testing in xowiki like in the page below...

>left-col<<
Gustaf Neumann This is the Personal Wiki-Page of Gustaf Neumann. This shows, how to place arbitrary text into a kind of Portal-Page developed as a wiki.

-gustaf neumann

{{adp portlet-ajax {title Groups portlet /dotlrn/dotlrn-main-portlet ID 1}}}
{{adp portlet-ajax {title MESSAGE KEY MISSING: 'forums-portlet.pretty_name' portlet forums-portlet ID 2}}}

><<

>right-col<<
{{adp portlet-ajax {title MESSAGE KEY MISSING: 'dotlrn-calendar.Day_Summary' portlet calendar-portlet ID 3}}}
><<
Collapse
Posted by Gustaf Neumann on
just to make it clear: in my previous posting the "MESSAGE KEY MISSING '...'" message were introduced by the forum, please replace it by sensible titles if you want to try this example with cut&paste.