Examples of delayBroadcast()


Examples of org.atmosphere.cpr.Broadcaster.delayBroadcast()

            // Ping the connection every 30 seconds
            bc.scheduleFixedBroadcast(req.getRemoteAddr() + "**is still listening", 30, TimeUnit.SECONDS);

            // Delay a message until the next broadcast.
            bc.delayBroadcast("Delayed Chat message");
        } else if (req.getMethod().equalsIgnoreCase("POST")) {
            String action = req.getParameterValues("action")[0];
            String name = req.getParameterValues("name")[0];

            if ("login".equals(action)) {
View Full Code Here

Examples of org.atmosphere.cpr.Broadcaster.delayBroadcast()

                        Object t = f.get();
                        if (o instanceof Broadcastable) {
                            r.setEntity(returnMsg);
                        }
                    } else if (delay == 0) {
                        b.delayBroadcast(msg);
                    } else {
                        b.delayBroadcast(msg, delay, TimeUnit.SECONDS);
                    }
                } catch (InterruptedException ex) {
                    logger.error("broadcast interrupted", ex);
View Full Code Here

Examples of org.atmosphere.cpr.Broadcaster.delayBroadcast()

                            r.setEntity(returnMsg);
                        }
                    } else if (delay == 0) {
                        b.delayBroadcast(msg);
                    } else {
                        b.delayBroadcast(msg, delay, TimeUnit.SECONDS);
                    }
                } catch (InterruptedException ex) {
                    logger.error("broadcast interrupted", ex);
                } catch (ExecutionException ex) {
                    logger.error("execution exception during broadcast", ex);
View Full Code Here

Examples of org.atmosphere.cpr.Broadcaster.delayBroadcast()

        if (msg == null) return view;

        if (delay == -1) {
            broadcaster.broadcast(msg);
        } else if (delay == 0) {
            broadcaster.delayBroadcast(msg);
        } else {
            broadcaster.delayBroadcast(msg, delay, TimeUnit.SECONDS);
        }
       
        if (!writeEntity) {
View Full Code Here

Examples of org.atmosphere.cpr.Broadcaster.delayBroadcast()

        if (delay == -1) {
            broadcaster.broadcast(msg);
        } else if (delay == 0) {
            broadcaster.delayBroadcast(msg);
        } else {
            broadcaster.delayBroadcast(msg, delay, TimeUnit.SECONDS);
        }
       
        if (!writeEntity) {
            view = new EmptyView();
        }
View Full Code Here

Examples of org.atmosphere.cpr.Broadcaster.delayBroadcast()

                    b.broadcast(msg);
                    if (o instanceof Broadcastable) {
                        r.setEntity(returnMsg);
                    }
                } else if (delay == 0) {
                    b.delayBroadcast(msg);
                } else {
                    b.delayBroadcast(msg, delay, TimeUnit.SECONDS);
                }
            }
        }
View Full Code Here

Examples of org.atmosphere.cpr.Broadcaster.delayBroadcast()

                        r.setEntity(returnMsg);
                    }
                } else if (delay == 0) {
                    b.delayBroadcast(msg);
                } else {
                    b.delayBroadcast(msg, delay, TimeUnit.SECONDS);
                }
            }
        }

        void addFilter(Broadcaster bc) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.