.eventExecutor(eventExecutor)
.create();
eventReceiver.open();
EventSubscription subscription = eventReceiver.subscribeAll(new GenesysEventListener() {
@Override public void eventReceived(GenesysEvent event) {
System.err.println(
"Handling event received from channel " + event.getChannel()
+ " in thread " + Thread.currentThread().getName()
+ " with content " + event.getContent());
}
});
client.createRequest("POST", "/api/v2/me")
.operationName("Ready")
.execute();
Thread.sleep(1000);
client.createRequest("POST", "/api/v2/me")
.operationName("NotReady")
.execute();
Thread.sleep(1000);
subscription.unsubscribe();
Thread.sleep(1000);
}