this.session = Preconditions.checkNotNull(session);
}
- void write(final Notification msg) {
+ private void ensureWritable() {
if (blocked) {
LOG.trace("Blocked slow path tripped on session {}", session);
synchronized (this) {
LOG.debug("Resuming write on session {}", session);
}
}
+ }
+
+ void write(final Notification msg) {
+ ensureWritable();
+ session.write(msg);
+ }
- session.sendMessage(msg);
+ void writeAndFlush(final Notification msg) {
+ ensureWritable();
+ session.writeAndFlush(msg);
}
void flush() {
- // FIXME: no-op, as we do not have hatching APIs in session yet
+ session.flush();
}
@Override