Add a slave delegate
545990
def add_slave(self, slave, container_name="widget"):
        
        cont = getattr(self, container_name, None)
        if cont is None:
            raise AttributeError(
                'Container name must be a member of the delegate')
        cont.add(slave.widget)
        self.slaves.append(slave)
        return slave
761919
function delegate(id, method, options) {
  if (typeof openpgp[method] !== 'function') {
    response({ id:id, event:'method-return', err:'Unknown Worker Event' });
    return;
  }
  // construct ReadableStreams from MessagePorts
  openpgp.util.restoreStreams(options);
  // parse cloned packets
  options = openpgp.packet.clone.parseClonedPackets(options, method);
  openpgp[method](options).then(function(data) {
    // clone packets (for web worker structured cloning algorithm)
    response({ id:id, event:'method-return', data:openpgp.packet.clone.clonePackets(data) });
  }).catch(function(e) {
    openpgp.util.print_debug_error(e);
    response({
      id:id, event:'method-return', err:e.message, stack:e.stack
    });
  });
}
890171
public ServerUpdater addRolesToUser(User user, Collection<Role> roles) {
        delegate.addRolesToUser(user, roles);
        return this;
    }
801475
def become_slave(self, broker):
        '''
        
        '''
        self._set_state(BrokerRole.slave)
        self._master = broker
        d = defer.succeed(None)
        if callable(self.on_slave_cb):
            d.addCallback(defer.drop_param, self.on_slave_cb)

        d.addCallback(defer.drop_param, self._master.callRemote,
                      'handshake', self, self.agency, self.agency.agency_id,
                      self.is_standalone())
        d.addCallback(defer.inject_param, 1, self.update_state,
                      'reset_locally')

        for medium in self.agency.iter_agents():
            d.addCallback(defer.drop_param, self.register_agent, medium)

        return d
1125452
@Override
    public void add(int index, Object element) {
        rewrite |= index < delegate.size();

        delegate.add(index, element);
    }
439054
def add_delegate(self, callback):
        

        if callback in self._delegate_methods:
            return

        self._delegate_methods.append(callback)
1288601
def _set_slave_enabled(self, dpid, port, enabled):
        """"""
        slave = self._get_slave(dpid, port)
        if slave:
            slave['enabled'] = enabled
975191
private void delegateChanged(Observable<T> oldDelegate, Observable<T> newDelegate)
	{
		removeObservableListeners(oldDelegate);
		
		addObservableListeners(newDelegate);

		support.fireValueChanged(oldDelegate.getValue(), newDelegate.getValue());
	}
374264
void attach() {
    editors.addAll(editorSource.create(workingCopy.size(), 0));
    final int size = workingCopy.size();
    for (int i = 0; i < size; i++) {
      chain.attach(workingCopy.get(i), editors.get(i));
    }
  }
1154122
def _set_slave_timeout(self, dpid, port, timeout):
        """"""
        slave = self._get_slave(dpid, port)
        if slave:
            slave['timeout'] = timeout
687897
function sync_config($slave){
		foreach ($this->addf as $k => $v)
			$slave->add_field($v);
		foreach ($this->delf as $k => $v)
			$slave->remove_field($v);
	}
480512
private static String adjustData(String data, ClassNode type, DelegationMetadata dmd) {
        StringBuilder path = new StringBuilder();
        int i = 0;
        String[] propertyPath = data.split("\\.");
        while (dmd != null) {
            int strategy = dmd.getStrategy();
            ClassNode delegate = dmd.getType();
            dmd = dmd.getParent();
            switch (strategy) {
                case Closure.DELEGATE_FIRST:
                    if (!delegate.isDerivedFrom(CLOSURE_TYPE) && !delegate.isDerivedFrom(type)) {
                        path.append("owner"); // must be non-delegate case
                    } else {
                        path.append("delegate");
                    }
                    break;
                default:
                    if (i >= propertyPath.length) return data;
                    path.append(propertyPath[i]);
            }
            if (type.equals(delegate)) break;
            i++;
            if (dmd != null) path.append('.');
        }
        String result = path.toString();
        if (!result.isEmpty()) {
            return result;
        }
        return data;
    }
703254
public void lockAndSwitchSecondary(Protocol newSecondaryProtocol) throws SQLException {
    if (secondaryProtocol != null && !secondaryProtocol.isClosed()) {
      secondaryProtocol.close();
    }

    //if asked to be on read only connection, switching to this new connection
    if (currentReadOnlyAsked || (urlParser.getOptions().failOnReadOnly && !currentReadOnlyAsked
        && isMasterHostFail())) {
      if (currentProtocol == null) {
        try {
          syncConnection(currentProtocol, newSecondaryProtocol);
        } catch (Exception e) {
          //Some error append during connection parameter synchronisation
        }
      }
      currentProtocol = newSecondaryProtocol;
    }

    //set new found connection as slave connection.
    this.secondaryProtocol = newSecondaryProtocol;
    if (urlParser.getOptions().assureReadOnly) {
      setSessionReadOnly(true, this.secondaryProtocol);
    }

    resetSecondaryFailoverData();
  }
556481
protected void delegate(StreamMessage<T> delegate) {
        requireNonNull(delegate, "delegate");

        if (!delegateUpdater.compareAndSet(this, null, delegate)) {
            throw new IllegalStateException("delegate set already");
        }

        if (abortPending != 0) {
            delegate.abort();
        }

        if (!completionFuture().isDone()) {
            delegate.completionFuture().handle((unused, cause) -> {
                if (cause == null) {
                    completionFuture().complete(null);
                } else {
                    completionFuture().completeExceptionally(cause);
                }
                return null;
            }).exceptionally(CompletionActions::log);
        }

        safeOnSubscribeToDelegate();
    }
265334
def with_slave(uid, &block)
      slave = get_slave(uid, @io)
      slave.debug = debug
      slave.raise_exception_on_mismatch = raise_exception_on_mismatch
      slave.read_retries = read_retries
      slave.read_retry_timeout = read_retry_timeout
      if block_given?
        yield slave
      else
        slave
      end
    end
904049
def slaves(self, name):
        """"""
        fut = self.execute(b'SLAVES', name, encoding='utf-8')
        return wait_convert(fut, parse_sentinel_slaves_and_sentinels)
315854
def delegate(self, success, **kwargs):
        """"""
        if success:
            self.succeeded(**kwargs)
        else:
            self.failed(**kwargs)