Thomas,

Here is our client setup code for the pipes:
        transport = new QosRequestTransport();


        QosManager manager = new QosManager();


        QosQueue root = new QosQueue();
        root.setTarget(manager);

        final QosQueue primary = injector.getDefaultPipe();
        primary.setTarget(root);

        // pipe we don't bug the user about
        QosQueue background = injector.getBackgroundPipe();
        background.setTarget(root);
        background.addModifier(new Priority(0.5f));

        final BusyDisplay busyDisplay = 
UasInjector.INSTANCE.getBusyDisplay();

        manager.addListener(new QosListener() {
            @Override
            public void tick(List<QosEntry> list) {
                boolean block = false;
                for (QosEntry entry : list) {
                    if (entry.getScore() >= 1.0f) {
                        block = true;
                        break;
                    }
                }
                if (busyDisplay.isShowing()) {
                    if (!block) {
                        busyDisplay.hide();
                    }
                } else {
                    if (block) {
                        busyDisplay.show();
                    }
                }
            }

            @Override
            public void retryStarting(int retryCount) {
                busyDisplay.setMessage("Possible network problem. Retry " + 
retryCount + "...");
            }
        });

        manager.start();

        transport.setDefaultSource(primary);

NB if you fire a RequestContext in the normal way it gets captured by the 
QosManager... Really ugly code relying on the single threaded nature of JS. 
Might ask for more hooks from the core GWT/RequestFactory.

btw This is definitely meant to be sugar on top of an amazingly good 
framework.

Cheers

Sam

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to