uklance / tapestry-cometd

A push library for Tapestry5 based on CometD
17 stars 3 forks source link

Serverside push batching #17

Open uklance opened 12 years ago

uklance commented 12 years ago

http://cometd.org/node/70

    public class BatchingService extends BayeuxService
    {
        public void processBatch(Client remote, Message message)
        {
            remote.startBatch();

            Map<String, Object> externalData = new HashMap<String, Object>();
            // Fill the external data
            remote.deliver(getClient(), "/external", externalData, null);

            Map<String, Object> emailData = new HashMap<String, Object>();
            // Fill the email data
            remote.deliver(getClient(), "/email", emailData, null);

            remote.endBatch();
        }
    }