SyncProcess class
773022
function SyncProcess(file, args, options) {
    this.file = file;
    this.args = args.slice(0);
    this.args.unshift(this.file);
    this.options = Object.create(options || null);
    this.normalizeOptions(this.options);
    this.initStdioPipe(this.options);
}
528317
function(syncIt) {
	/* global setInterval */
	this._syncIt = syncIt;
	this._instructions = [];
	this._current = null;
	setInterval(function() {
		var args, c;
		if ((this._current === null) && this._instructions.length) {
			this._current = this._instructions.shift();
			args = Array.prototype.slice.call(this._current.a);
			args.push(function(e) {
				if (e !== SyncItConstant.Error.UNABLE_TO_PROCESS_BECAUSE_LOCKED) {
					c = this._current.c;
					this._current = null;
					c.apply(
						this._syncIt,
						arguments
					);
				}
			}.bind(this));
			this._current.f.apply(this._syncIt, args);
		}
	}.bind(this), 50);
}
1197663
def synchronizer_class(self):
        
        if not self.synchronizer_path or self.synchronizer_path == 'None' or not self.layer:
            return False
        # ensure data is up to date
        if (self._synchronizer_class is not None and self._synchronizer_class.__name__ not in self.synchronizer_path):
            self._synchronizer = None
            self._synchronizer_class = None
        # import synchronizer class only if not imported already
        if not self._synchronizer_class:
            self._synchronizer_class = import_by_path(self.synchronizer_path)
        return self._synchronizer_class
1179881
async def executor(func, *args, **kwargs):
    '''
    
    '''
    def syncfunc():
        return func(*args, **kwargs)

    loop = asyncio.get_running_loop()
    return await loop.run_in_executor(None, syncfunc)
1053017
def example_sync_client(api_client):
    

    try:
        pprint(api_client.echo())
    except errors.RequestError as exc:
        log.exception('Exception occurred: %s', exc)
480889
def contribute_to_class(self, process, fields, name):
        
        self.name = name
        self.process = process
        fields[name] = self
883054
def sync(
        self
    ):
        
        self.log.info('starting the ``sync`` method')

        taskpaperFiles = self._get_all_taskpaper_files(self.workspaceRoot)
        for k, v in self.syncTagSets.iteritems():
            self._complete_original_tasks(setName=k)

        for k, v in self.syncTagSets.iteritems():
            workflowTagSet = False
            for tag in v:
                if tag in self.workflowTags:
                    workflowTagSet = True

            content = self._get_tagged_content_from_taskpaper_files(
                taskpaperFiles,
                tagSet=v,
                workflowTagSet=workflowTagSet,
                includeFileTags=self.includeFileTags
            )
            if content:
                taskpaperDocPath = self._create_single_taskpaper_task_list(
                    content, setName=k)
                self._create_html_tasklist(taskpaperDocPath)

        # self._generate_sync_documents()

        self.log.info('completed the ``sync`` method')
        return None
532739
protected <L, S extends Persistable<L>>
    S _sync(
                    final Class<S> type,
                    final S object
                    )
    {
        if (_LOG_.isTraceEnabled()) {
            _LOG_.trace( "type: " + type.getName() );
            _LOG_.trace( "object: " + object );
        }

        if (object == null) {
            return null;
        }

        CastorDao<L, S>  dao = getForwardingDao( type );
        S  p_object = dao._sync( object );

        return p_object;
    }
350650
private <T extends IGPSObject> T syncCommand(final String command, final Class<T> responseClass) throws IOException {
		synchronized (this.asyncMutex) {
			if (out != null) {
				this.out.write(command + "\n");
				this.out.flush();
			}
			if (responseClass == WatchObject.class) {
				lastWatch = command;
			}
			while (true) {
				// wait for awaited message
				// FIXME possible infinite loop if expected result arrives but new result overrides expected result before getting to this point.
				final IGPSObject result = this.waitForResult();
				if ((result == null) || result.getClass().equals(responseClass)) {
					return responseClass.cast(result);
				}
			}
		}
	}
1187158
function _syncWithFileSystem() {
        _mrofList = _mrofList.filter(function (e) {return e; });
        return Async.doSequentially(_mrofList, _checkExt, false);
    }
351053
public static void main(String[] args) throws Exception {
        SyncOptimizeDriver syncOptDriver = new SyncOptimizeDriver(true);
        SyncOptimizeConfig syncOptConfig =
            syncOptDriver.processCommandLineArgs(args);

        System.out.println("### Running Sync Thread Optimizer with configuration: " +
                           syncOptConfig.getPrintableConfig());

        int optimalThreads = syncOptDriver.getOptimalThreads(syncOptConfig);

        System.out.println("### Sync Thread Optimizer complete. Optimal thread " +
                           "count for running the DuraCloud SyncTool on " +
                           "this machine is: " + optimalThreads);
    }
1061643
@Override
    public void sync(
            final ObjectClass objClass,
            final SyncToken token,
            final SyncResultsHandler handler,
            final OperationOptions options) {

        // check objectclass
        if (objClass == null || (!objClass.equals(ObjectClass.ACCOUNT))) {
            throw new IllegalArgumentException("Invalid objectclass");
        }

        // check objectclass
        if (handler == null) {
            throw new IllegalArgumentException("Invalid handler");
        }

        // get web service client
        final Provisioning provisioning = connection.getProvisioning();
        if (provisioning == null) {
            throw new IllegalStateException("Web Service client not found");
        }

        try {
            final List<WSChange> changes = provisioning.sync();

            SyncDeltaBuilder sdb = null;

            boolean handle = true;
            for (final Iterator<WSChange> i = changes.iterator(); i.hasNext() && handle;) {
                final WSChange change = i.next();

                if (LOG.isOk()) {
                    LOG.ok("Found change {0}", change);
                }

                try {
                    sdb = buildSyncDelta(change);
                    handle = handler.handle(sdb.build());
                } catch (Exception e) {
                    LOG.error(e, "Error building connector object for change {0}", change);
                }
            }
        } catch (ProvisioningException e) {
            LOG.error("Synchronization failed");

            throw new IllegalStateException(e);
        }
    }
242116
def sync!
      events = @matrix.sync since: @since
      process_sync events
    rescue ApiError => err
      broadcast(:sync_error, err)
    end
1067973
def clean(self, *args, **kwargs):
        
        if self.synchronizer_path != 'None' and self.config:
            # call synchronizer custom clean
            try:
                self.synchronizer.load_config(self.config)
                self.synchronizer.clean()
            except ImproperlyConfigured as e:
                raise ValidationError(e.message)
425553
function(concurrency, tasksPerProcess) {
  this.childs = [];
  for(var i = 0; i < concurrency; i += 1) {
    this.childs[i] = new Child(tasksPerProcess);
  }
}
42328
public static boolean synchronousSync(CuratorFramework curator, Duration timeout) {
        try {
            // Curator sync() is always a background operation.  Use a latch to block until it finishes.
            final CountDownLatch latch = new CountDownLatch(1);
            curator.sync().inBackground(new BackgroundCallback() {
                @Override
                public void processResult(CuratorFramework curator, CuratorEvent event) throws Exception {
                    if (event.getType() == CuratorEventType.SYNC) {
                        latch.countDown();
                    }
                }
            }).forPath(curator.getNamespace().isEmpty() ? "/" : "");

            // Wait for sync to complete.
            return latch.await(timeout.toMillis(), TimeUnit.MILLISECONDS);
        } catch (InterruptedException e) {
            return false;
        } catch (Exception e) {
            throw Throwables.propagate(e);
        }
    }
740321
def sync(self, bForce):
        """"""

        fn = self.function_table.sync
        peError = EVRSettingsError()
        result = fn(bForce, byref(peError))
        return result, peError