I'm not sure I understand. Which part are you saying is synchronous?
self.manager.addWidget does this:
widget.manager = this;
this.widgets[
widget.id] = widget;
That doesn't take any time at all. Plus, you only run it once when your app first loads. You'd have to be adding thousands/millions of widgets with addWidget to freeze the browser.
As for "new AjaxSolr.TagcloudWidget", the constructor also returns very quickly:
https://github.com/evolvingweb/ajax-solr/blob/master/core/AbstractFacetWidget.js#L27
So, there's nothing in that line of code that is slow.
The AJAX request is done asynchronously to prevent network latency and transfer speeds from causing the app the appear slow. The processing of the response is done synchronously - but there is no real alternative. One way or another, that responses needs to get processed. You can either reduce the number of widgets, or use the beforeRequest method on each widget to add a loading animation, and remove the loading animation in the afterRequest method.
James
> --
> You received this message because you are subscribed to the Google Groups "ajax-solr" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
ajax-solr+...@googlegroups.com.
> For more options, visit
https://groups.google.com/groups/opt_out.
>
>