src/main/java/toy/das/atomicBroadcast/RBrodcastService.java
/**
     * Atomic Deliver the first message of a given channel. Note that this is a blocking call.
     * @param channel the channel to which we need to deliver the message (with a single Toy group this is always 0)
     * @return the delivered message
     * @throws InterruptedException
     */
Atomic Deliver the first message of a given channel. Note that this is a blocking call.
@param channel the channel to which we need to deliver the message (with a single Toy group this is always 0)
@return the delivered message
@throws InterruptedException
Atomic Deliver the first message of a given channel . Note that this is a blocking call . @param channel the channel to which we need to deliver the message ( with a single Toy group this is always 0 ) @return the delivered message @throws InterruptedException
public byte[] deliver(int channel) throws InterruptedException {
        synchronized (cNotifyer[channel]) {
            while (!recMsg.containsKey(channel) || recMsg.get(channel).isEmpty()) {
                cNotifyer[channel].wait();
            }
            Types.RBMsg msg = recMsg.get(channel).get(0);
            recMsg.get(channel).remove(0);
            return msg.getData().toByteArray();
        }
    }
public byte [ ] deliver ( int channel ) throws InterruptedException { synchronized ( cNotifyer [ channel ] ) { while ( ! recMsg . containsKey ( channel ) || recMsg . get ( channel ) . isEmpty ( ) ) { cNotifyer [ channel ] . wait ( ) ; } Types . RBMsg msg = recMsg . get ( channel ) . get ( 0 ) ; recMsg . get ( channel ) . remove ( 0 ) ; return msg . getData ( ) . toByteArray ( ) ; } }
Atomic Deliver the first message of a given channel.
Atomic Deliver the first message of a given channel .