@Override public void startup() { pubSubService.publishTopic("next"); }
/** * Used to create a new pubsub service with specific queue length and a max message size * @param queueLength int to be passed to PubSubService * @param maxMessageSize int to be passed to PubSubService * @return new PubSubService */ public PubSubService newPubSubService(int queueLength, int maxMessageSize) { return new PubSubService(this,queueLength,maxMessageSize); }
public void presumePublishTopic(CharSequence topic, Writable writable) { presumePublishTopic(topic,writable, WaitFor.All); }
private void changeState(long time, StopLight target) { if (channel.changeStateTo(target)) { console.append(target.getColor()).append(" "); Appendables.appendEpochTime(console, time).append('\n'); } else { console.append("unable to send state change, to busy"); } }
@Override public boolean responseHTTP(HTTPResponseReader reader) { // System.out.println("xxxxxxxxxxxxxxxxxxx"); // reader.openPayloadData( (r)-> { // StructuredReader s = r.structured(); // int value1 = s.readInt(Fields.AGE); // String value2 = s.readText(Fields.NAME); // // //System.out.println(value1+" "+value2); // }); pubSubService.publishTopic("next"); return true; }
/** * Used to create a new pubsub service * @return new PubSubService */ public PubSubService newPubSubService() { return new PubSubService(this); }
/** * Publishes specified topic with data written onto this channel * @param topic topic to be specified for publish * @param writable to write data into this channel * @return published topic */ public boolean publishTopic(TopicWritable topic, Writable writable) { return publishTopic(topic, writable, WaitFor.All); }
public boolean publishTopic(TopicWritable topic) { return publishTopic(topic, WaitFor.All); }
public boolean publishTopic(TopicWritable topic, WaitFor ap) { return publishTopic(topic, ap); }
public void presumePublishTopic(CharSequence topic, Writable writable, WaitFor waitFor) { assert((0 != (msgCommandChannel.initFeatures & MsgCommandChannel.DYNAMIC_MESSAGING))) : "CommandChannel must be created with DYNAMIC_MESSAGING flag"; if (!publishTopic(topic, writable, waitFor)) { logger.warn("unable to publish on topic {} must wait.",topic); while (!publishTopic(topic, writable, waitFor)) { Thread.yield(); } } }
@Override public boolean message(CharSequence topic, ChannelReader payload) { if (--countDown<=0) { clientService.httpGet(session, "/shutdown?key=shutdown"); pubSubService.publishTopic("shutdown"); } reqTime = System.nanoTime(); return clientService.httpGet(session, "/testPageB"); }