use of co.paralleluniverse.common.io.Streamable in project quasar by puniverse.
the class GlxRemoteChannel method send.
private static void send(Object message, GlxGlobalChannelId id) throws SuspendExecution {
LOG.debug("sent {}", message);
try {
if (id.isGlobal()) {
final long ref = id.getAddress();
if (message instanceof Streamable) {
getStore().send(ref, (Streamable) message);
} else {
final byte[] buf = Serialization.getInstance().write(message);
getStore().send(ref, buf);
}
} else {
final short node = (short) id.getAddress();
if (message instanceof Streamable) {
getMessenger().send(node, (Long) id.getTopic(), (Streamable) message);
} else {
final byte[] buf = Serialization.getInstance().write(message);
getMessenger().send(node, (Long) id.getTopic(), buf);
}
}
} catch (TimeoutException e) {
throw new RemoteException(e);
}
}
Aggregations