Search in sources :

Example 1 with SelectActionImpl

use of co.paralleluniverse.strands.channels.SelectActionImpl in project quasar by puniverse.

the class ValChannel method register.

@Override
public Object register(SelectAction<V> action1) {
    SelectActionImpl<V> action = (SelectActionImpl<V>) action1;
    if (action.isData())
        throw new UnsupportedOperationException("Send is not supported by DelayedValChanel");
    Condition sync = dv.getSync();
    if (sync == null) {
        if (!action.lease())
            return null;
        action.setItem(dv.getValue());
        action.won();
        return null;
    }
    sync.register();
    return action;
}
Also used : Condition(co.paralleluniverse.strands.Condition) SelectActionImpl(co.paralleluniverse.strands.channels.SelectActionImpl)

Aggregations

Condition (co.paralleluniverse.strands.Condition)1 SelectActionImpl (co.paralleluniverse.strands.channels.SelectActionImpl)1