Skip to content

Commit

Permalink
One more fix for #890, disable the mechanisim with SimpleBroadcaster
Browse files Browse the repository at this point in the history
  • Loading branch information
jfarcand committed Feb 8, 2013
1 parent cdad238 commit 2d6974b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ public class DefaultBroadcaster implements Broadcaster {
protected BroadcasterCache.STRATEGY cacheStrategy = BroadcasterCache.STRATEGY.AFTER_FILTER;
private final Object[] awaitBarrier = new Object[0];
private final AtomicBoolean outOfOrderBroadcastSupported = new AtomicBoolean(false);
private int writeTimeoutInSecond = -1;
protected int writeTimeoutInSecond = -1;

public DefaultBroadcaster(String name, URI uri, AtmosphereConfig config) {
this.name = name;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,10 @@
package org.atmosphere.util;


import org.atmosphere.cpr.ApplicationConfig;
import org.atmosphere.cpr.AtmosphereConfig;
import org.atmosphere.cpr.AtmosphereResource;
import org.atmosphere.cpr.AtmosphereResourceEvent;
import org.atmosphere.cpr.BroadcasterConfig;
import org.atmosphere.cpr.BroadcasterFuture;
import org.atmosphere.cpr.DefaultBroadcaster;
Expand All @@ -63,6 +65,7 @@

import java.util.Set;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;

/**
* Simple {@link org.atmosphere.cpr.Broadcaster} implementation that use the calling thread when broadcasting events.
Expand Down Expand Up @@ -164,6 +167,15 @@ public <T> Future<T> broadcast(T msg, Set<AtmosphereResource> subset) {
return f;
}

@Override
protected void prepareInvokeOnStateChange(final AtmosphereResource r, final AtmosphereResourceEvent e) {
if (writeTimeoutInSecond != -1) {
logger.warn("{} not supported with this broadcaster.", ApplicationConfig.WRITE_TIMEOUT);
}
invokeOnStateChange(r, e);
}


/**
* {@inheritDoc}
*/
Expand Down

0 comments on commit 2d6974b

Please sign in to comment.