callback from save thread
540306
def save_callback(operation, graphdef):
    ''''''
    if operation == 'test':
        for e in graphdef.expressions:
            if expression_ok(e):
                graphdef.expression = e
                display_graph(graphdef)
                return
        mestate.console.writeln('Invalid graph expressions', fg='red')
        return
    if operation == 'save':
        save_graph(graphdef)
1143837
void save(CallInfo callInfo) {
    access(callInfo, () -> {
      if (!savepointSupport) {
        throw new UnsupportedOperationException("Savepoints are not supported by the database driver.");
      }
      logSetup(callInfo);
      clearSavePointIfSet();
      if (connection.getAutoCommit()) {
        throw new InvalidOperationException("Auto-commit is set for database connection.");
      }      
      savepoint = connection.setSavepoint();
      return 0;
    });
  }
53457
function callbackOnce(err, arg) {
            var cb = callback;
            callback = null;
            if (cb) { cb(err, arg); }
        }
16300
def save_self(execute_hooks = true)
      # short-circuit if the resource is not dirty
      return saved? unless dirty_self?

      if execute_hooks
        new? ? create_with_hooks : update_with_hooks
      else
        _persist
      end
      clean?
    end
1191406
def save(callLog, logFilename):
    
    with open(logFilename, "wb") as outp:
      cPickle.dump(callLog, outp)
854581
def save(path, json_data):
        
        try:
            loop = asyncio.get_event_loop()
            if loop.is_running():
                asyncio.run_coroutine_threadsafe(Persistence._save(path, json_data), loop)
            else:
                loop.run_until_complete(Persistence._save(path, json_data))
        except AssertionError:
            Persistence._save(path, json_data)
256973
private final void _writeCallback(Persistable persistable) throws IOException 
    {
        if (_callbackToItem)
        {
            try
            {
                String className = persistable.getItemClassName();
                AbstractItem item = (AbstractItem) (Class.forName(className).newInstance());
                List<DataSlice> dataSlices = _persistentMessageStore.readDataOnly(persistable);
                if (dataSlices != null)
                {
                    item.restore(dataSlices);
                    item.xmlWriteOn(_writer);
                }
            }
            catch (IOException ioexc)
            {
                // No FFDC code needed
                // as this is fault diagnostic code, and the exception 
                // will be dumped to the output anyway
                _writer.write(ioexc);
                throw ioexc;
            }
            catch (Throwable t)
            {
                // No FFDC code needed
                // as this is fault diagnostic code, and the exception 
                // will be dumped to the output anyway
                _writer.write(t);
            }
        }
    }
308736
def _execute_callback(self, callback, data):
        """"""
        web_client = WebClient(
            token=self.token, base_url=self.base_url, ssl=self.ssl, proxy=self.proxy
        )
        with concurrent.futures.ThreadPoolExecutor(max_workers=1) as executor:
            # Execute the callback on a separate thread,
            future = executor.submit(
                callback, rtm_client=self, web_client=web_client, data=data
            )

            while future.running():
                pass

            future.result()
1027299
def do_callback(self, pkt):
        
        callback, parser = self.get_callback_parser(pkt)

        if asyncio.iscoroutinefunction(callback):
            self.loop.call_soon_threadsafe(self._do_async_callback,
                                           callback, parser)
        else:
            self.loop.call_soon(callback, parser)
1167636
@Override
    public void submitToMember(Runnable command, Member member, ExecutionCallback callback) {
        Callable<?> callable = createRunnableAdapter(command);
        submitToMember(callable, member, callback);
    }
949123
public static void waitForDie(Thread thread) {
		boolean dead = false;
		do {
			try {
				thread.join();
				dead = true;
			} catch (InterruptedException e) {
				// ignore
			}
		} while (!dead);
	}
197208
def _save_log_pos_thread_runner(self):
        
        _logger.debug('Start log pos saving thread')
        while not self.save_log_pos_thread_stop_flag.wait(self.interval):
            self._save_file_and_pos()
        _logger.debug('Finish log pos saving thread')
688410
def save_callback(sender, instance, created, update_fields, **kwargs):
    """"""
    if validate_instance(instance):
        status = 'add' if created is True else 'change'
        change = ''

        if status == 'change' and 'al_chl' in instance.__dict__.keys():
            changelog = instance.al_chl.modification
            change = ' to following changed: {}'.format(changelog)

        processor(status, sender, instance, update_fields, addition=change)
755121
def __callback (self, event):
        '''
        

        '''
        bump = bumperEvent2BumperData(event)

        if bump.state == 1:
            self.lock.acquire()
            self.time = current_milli_time()
            self.data = bump
            self.lock.release()
131799
function (callbackId, data, keepAlive) {
    const args = [callbackId]
    data && args.push(data)
    keepAlive && args.push(keepAlive)
    _send(this.instanceId, {
      method: 'callback',
      args: args
    })
  }
939554
def _run_progress_callbacks(self, bytes_transferred):
        '''  '''
        if bytes_transferred:
            for callback in self._progress_callbacks:
                try:
                    callback(bytes_transferred=bytes_transferred)
                except Exception as ex:
                    logger.error("Exception: %s" % str(ex))
1357793
function execute(req, res) {
  this.log.notice('background saving started by pid %s', process.pid);
  function onSave(err) {
    /* istanbul ignore next: not prepared to mock this right now */
    if(err) return this.log.warning('background save failed: %s', err.message);
    this.log.notice('background saving terminated with success')
  }
  Persistence.save(this.state.store, this.state.conf, onSave.bind(this));
  res.send(null, Constants.BGSAVE);
}