lib/barrier/index.js
function registerParticipant (name, participant) {
  let barrier = barriers[name];

  if (!barrier) {
    debug (`creating barrier ${name}`);
    barrier = barriers[name] = new Barrier ({name});
  }

  debug (`registering participant with barrier ${name}`);
  return barrier.registerParticipant (participant);
}
function registerParticipant (name, participant) {
  let barrier = barriers[name];

  if (!barrier) {
    debug (`creating barrier ${name}`);
    barrier = barriers[name] = new Barrier ({name});
  }

  debug (`registering participant with barrier ${name}`);
  return barrier.registerParticipant (participant);
}
function registerParticipant ( name , participant ) { let barrier = barriers [ name ] ; if ( ! barrier ) { debug ( ` ${ name } ` ) ; barrier = barriers [ name ] = new Barrier ( { name } ) ; } debug ( ` ${ name } ` ) ; return barrier . registerParticipant ( participant ) ; }
Factory method for registering a participant with a barrier. If the barrier
does not exist, then a new barrier is created.

@param name              Name of the barrier
@param participant       JavaScript object
@returns {Barrier}
Factory method for registering a participant with a barrier . If the barrier does not exist then a new barrier is created .