Allow downstream and upstream messages to be compounded
A client can collect a bunch of messages into a CompoundUpstreamMessage, which are unpacked and dispatched in order by the server. The server collects any messages sent while processing that compound message into a CompoundDownstreamMessage, which is unpacked and dispatched by the client. This allows the client to indicate that it's going to send enough messages that it'd blow out the throttle, but that it's doing so intentionally. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6659 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
//
|
||||
// $Id$
|
||||
//
|
||||
// Narya library - tools for developing networked games
|
||||
// Copyright (C) 2002-2011 Three Rings Design, Inc., All Rights Reserved
|
||||
// http://code.google.com/p/narya/
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it
|
||||
// under the terms of the GNU Lesser General Public License as published
|
||||
// by the Free Software Foundation; either version 2.1 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License along with this library; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
package com.threerings.presents.net;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
/**
|
||||
* Groups messages to be dispatched without triggering the message throttle.
|
||||
*/
|
||||
public class CompoundDownstreamMessage extends DownstreamMessage
|
||||
{
|
||||
public List<DownstreamMessage> msgs = Lists.newArrayList();
|
||||
|
||||
@Override
|
||||
public String toString ()
|
||||
{
|
||||
return "[type=COMPOUND, msgid=" + messageId + "]";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user