run the init/quued calback when the trasnfer is initiated on apsera
427500
def _run_queued_callbacks(self):
        '''  '''
        for callback in self._queued_callbacks:
            try:
                callback()
            except Exception as ex:
                logger.error("Exception: %s" % str(ex))
1256581
def run():
    """"""
    parser = OptionParser(version='%prog {0}'.format(__version__))
    parser.add_option('-a', '--addr', default='localhost',
                      help=('The address or host to listen on. Specify -a '
                            '0.0.0.0 to listen on all addresses. '
                            'Default: localhost'))
    parser.add_option('-p', '--port', type='int', default='10101',
                      help=('The port to listen for requests on. '
                            'Default: 10101'))
    options, _ = parser.parse_args()
    try:
        server = ThreadingTCPServer((options.addr, options.port),
                                    RequestHandler)
    except (socket.error, socket.gaierror) as exc:  # Handle bind errors
        print(exc)
        sys.exit(1)
    print('Listening on {0} port {1}'.format(options.addr, options.port))
    try:
        server.serve_forever()  # pylint: disable=E1101
    except KeyboardInterrupt:
        server.socket.close()  # pylint: disable=E1101
        RequestHandler.http.close()
        print('Goodbye!')
1346589
public static synchronized void initialise() throws SIResourceException
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(tc, "initialise");
        if (!initialised)
        {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                SibTr.debug(tc, "not previously initialised");

            //   new com.ibm.ws.sib.jfapchannel.impl.ClientConnectionManagerImpl();
            Class clientImpl = instance.getClass();
            Method initialiseMethod;
            try
            {
                initialiseMethod = clientImpl.getMethod("initialise", new Class[] {});
                initialiseMethod.invoke(clientImpl, new Object[] {});
                initialised = true; // D223632
            } catch (Exception e)
            {
                FFDCFilter.processException
                                (e, "com.ibm.ws.sib.jfapchannel.ClientConnectionManager.initialise",
                                 JFapChannelConstants.CLNTCONNMGR_INITIALISE_01);

                SibTr.error(tc, "EXCP_DURING_INIT_SICJ0002", new Object[] { "initialise", JFapChannelConstants.CLIENT_MANAGER_CLASS, e });
                if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled())
                    SibTr.exception(tc, e);
                throw new SIResourceException(e);
            }

        }
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "initialise");
    }
557405
function init (context, event) {
  /* istanbul ignore if */
  if (process.env.LLTRACE_ON) {
    AWS.init(context.invokedFunctionArn);
  }

  AwsHelper._context = context;
  AwsHelper._event = event;
  AwsHelper._Lambda = null;
  AwsHelper._SNS = null;
  AwsHelper._DynamoDB = null;
  AwsHelper._parseInvokedFunctionArn(context.invokedFunctionArn);
  AwsHelper._AWS.config.region = AwsHelper.region;
  AwsHelper.log = AwsHelper.Logger();
  return AwsHelper;
}
88275
def start(self, buffer):
        """"""
        log.debug("In TftpContextServer.start")
        self.metrics.start_time = time.time()
        log.debug("Set metrics.start_time to %s", self.metrics.start_time)
        # And update our last updated time.
        self.last_update = time.time()

        pkt = self.factory.parse(buffer)
        log.debug("TftpContextServer.start() - factory returned a %s", pkt)

        # Call handle once with the initial packet. This should put us into
        # the download or the upload state.
        self.state = self.state.handle(pkt,
                                       self.host,
                                       self.port)
1330587
function initAsyncResource(asyncId, type, triggerAsyncId, resource) {
	if (wakingup) {
		return;
	}
	wakingup = true;
	setImmediate(() => {
		EventLoop.wakeupBackgroundThread();
		wakingup = false;
	});
}
744073
private void init() {
        assertUnlocked();
        
        lock.lock();
        try {
            httpSender.init(cfg);

            LOG.info(
                "Starting with "
                    + DEFAULT_REQ_PROC_COUNT + " request processors");

            procThreads = new RequestProcessor[DEFAULT_REQ_PROC_COUNT];

            for (int i = 0; i < procThreads.length; i++) {
                procThreads[i] = new RequestProcessor(i);
                procThreads[i].start();
            }

        } finally {
            lock.unlock();
        }
    }
28723
function execute(req, res) {
  req.conn.monitor(this);
  res.send(null, Constants.OK);
}
686464
def run_initializer(initializer, initargs):
    """"""
    try:
        initializer(*initargs)
        return True
    except Exception as error:
        logging.exception(error)
        return False
1233262
void setInitializationData(Bundle contributingBundle, ServiceReference<?> urlConverterSR) {
		if (this.contributingBundle != null || this.urlConverterSR != null) {
			throw new IllegalStateException();
		}
		this.contributingBundle = contributingBundle;
		this.urlConverterSR = urlConverterSR;
	}
2938
@Synchronized
    @SneakyThrows(Exception.class)
    private void tryInit() {
        if (!zkInit) {
            // we are making remote calls under a lock but this is only done for initialization at 
            // the start of controller process.
            ZKUtils.createPathIfNotExists(zkClient, zkPath, HostContainerMap.EMPTY.toBytes());
            hostContainerMapNode.getListenable().addListener(this::updateMap);
            hostContainerMapNode.start(true);
            updateMap();
            zkInit = true;
        }
    }
1110764
public void initialize(final int appId, ICallStatsTokenGenerator tokenGenerator,
      final String bridgeId, final ServerInfo serverInfo,
      final CallStatsInitListener callStatsInitListener) {
    if (appId <= 0 || StringUtils.isBlank(bridgeId) || serverInfo == null
        || callStatsInitListener == null) {
      logger.error("intialize: Arguments cannot be null ");
      throw new IllegalArgumentException("intialize: Arguments cannot be null");
    }

    this.appId = appId;
    this.tokenGenerator = tokenGenerator;
    this.bridgeId = bridgeId;
    this.listener = callStatsInitListener;
    this.serverInfo = serverInfo;
    CallStatsConfigProvider.init();

    httpClient = new CallStatsHttp2Client(CallStatsConfigProvider.connectionTimeOut);
    authHttpClient = new CallStatsHttp2Client(CallStatsConfigProvider.connectionTimeOut);
    authenticator = new CallStatsAuthenticator(appId, this.tokenGenerator, bridgeId, authHttpClient,
        new CallStatsInitListener() {
          public void onInitialized(String msg) {
            setInitialized(true);
            logger.info("SDK Initialized " + msg);
            startKeepAliveThread();
            listener.onInitialized(msg);
          }

          public void onError(CallStatsErrors error, String errMsg) {
            logger.info("SDK Initialization Failed " + errMsg);
            listener.onError(error, errMsg);;
          }
        });
    authenticator.doAuthentication();
  }
254768
function _run(init, rules, namespace) {
    const size = _size();
    let evts = rules || events;
    let	i;

    // If breakpoint has been hit or resize logic initialized
    if (size && (init || size !== current)) {
        if (namespace) {
            evts = evts.filter(obj => obj.namespace === namespace);
        }

        i = evts.length;

        while (i--) {
            const evt = evts[i];

            if (_eq(evt, size, init)) {
                const f = init && ! current;
                const data = {
                    dir: f ? 0 : (size > current ? 1 : -1),
                    init: f,
                    prev: current,
                    size,
                };

                $exec(evt.callback, {
                    args: evt.args ? [data].concat(evt.args) : [data],
                    scope: evt.scope,
                });

                // Disable future execution if once
                if (evt.once) {
                    events = events.filter(obj => obj.i !== evt.i);
                }
            }
        }

        // Cache current value
        current = size;
    }
}
640113
def _run(self, *args, **kwargs):
        
        apgw_rpc_bind_ip = _validate_rpc_ip(kwargs.pop(NC_RPC_BIND_IP))
        apgw_rpc_bind_port = _validate_rpc_port(kwargs.pop(NC_RPC_BIND_PORT))

        sock_addr = (apgw_rpc_bind_ip, apgw_rpc_bind_port)
        LOG.debug('NetworkController started listening for connections...')

        server_thread, _ = self._listen_tcp(sock_addr,
                                            self._start_rpc_session)
        self.pause(0)
        server_thread.wait()
637767
@PostConstruct
    public void init() {
        //init Bus and LifeCycle listeners
        if (bus != null && sendLifecycleEvent ) {
                ServerLifeCycleManager slcm = bus.getExtension(ServerLifeCycleManager.class);
                if (null != slcm) {
                    ServiceListenerImpl svrListener = new ServiceListenerImpl();
                    svrListener.setSendLifecycleEvent(sendLifecycleEvent);
                    svrListener.setQueue(queue);
                    svrListener.setMonitoringServiceClient(monitoringServiceClient);
                    slcm.registerListener(svrListener);
                }

                ClientLifeCycleManager clcm = bus.getExtension(ClientLifeCycleManager.class);
                if (null != clcm) {
                    ClientListenerImpl cltListener = new ClientListenerImpl();
                    cltListener.setSendLifecycleEvent(sendLifecycleEvent);
                    cltListener.setQueue(queue);
                    cltListener.setMonitoringServiceClient(monitoringServiceClient);
                    clcm.registerListener(cltListener);
                }
        }

        if(executorQueueSize == 0) {
        	executor = Executors.newFixedThreadPool(this.executorPoolSize);
        }else{
            executor = new ThreadPoolExecutor(executorPoolSize, executorPoolSize, 0, TimeUnit.SECONDS, 
            		new LinkedBlockingQueue<Runnable>(executorQueueSize), Executors.defaultThreadFactory(), 
            			new RejectedExecutionHandlerImpl());
        }

        scheduler = new Timer();
        scheduler.scheduleAtFixedRate(new TimerTask() {
            public void run() {
                sendEventsFromQueue();
            }
        }, 0, getDefaultInterval());
    }
1366942
def run_on(*, event: str):
        """"""

        def decorator(callback):
            @functools.wraps(callback)
            def decorator_wrapper():
                RTMClient.on(event=event, callback=callback)

            return decorator_wrapper()

        return decorator
1108379
def sg_init(sess):
     
    """
    # initialize variables
    sess.run(tf.group(tf.global_variables_initializer(),
                      tf.local_variables_initializer()))