channel.js
function put(item) {
    if (monitor) monitor("put", item);
    if (readQueue.length) {
      if (monitor) monitor("take", item);
      readQueue.shift()(null, item);
    }
    else {
      dataQueue.push(item);
    }
    return dataQueue.length <= bufferSize;
  }
function put(item) {
    if (monitor) monitor("put", item);
    if (readQueue.length) {
      if (monitor) monitor("take", item);
      readQueue.shift()(null, item);
    }
    else {
      dataQueue.push(item);
    }
    return dataQueue.length <= bufferSize;
  }
function put ( item ) { if ( monitor ) monitor ( "put" , item ) ; if ( readQueue . length ) { if ( monitor ) monitor ( "take" , item ) ; readQueue . shift ( ) ( null , item ) ; } else { dataQueue . push ( item ) ; } return dataQueue . length <= bufferSize ; }
Returns true when it's safe to continue without draining
Returns true when it s safe to continue without draining