finalize path and populate result for ConsumerConsumer
504004
def finalize_path(self, path_num=None):
        """"""
        for c in self.consumers:
            c.finalize_path(path_num)
        self.result = [c.result for c in self.consumers]
934947
def finalize(self):
        
        super(StringWriterConsumer, self).finalize()
        self.result = self.decoder(self.result)
1207290
function process_endpoint_result(raw_result) {
                const store_result = op.execute_on_store(raw_result);
                const result = NOOP === store_result
                    ? raw_result
                    : store_result
                    ;
                return resolve_promise(prepare_result(result));
            }
1032807
synchronized void result(@Nullable T res) {
        if (isFinished) {
            throw new RuntimeException("Promise " + this + " already completed!");
        }
        isFinished = true;
        result = res;
        deliverResult();
    }
930305
protected function populateResult()
    {
        // default: mark that the processor completed succesfully
        $this->result->setSuccess(true);

        // store output array in result data
        $this->result->output = $this->context->output;
    }
32546
JobSubmissionResult finalizeExecute() throws ProgramInvocationException {
		return client.run(detachedPlan, jarFilesToAttach, classpathsToAttach, userCodeClassLoader, savepointSettings);
	}
58419
def _finalize(self):
        
        self.logger.info("Finalizing...")
        self.write_manifest()

        if self.directory.rewrite_config:
            # always ensure .rc is written (sourcing .env)
            self.directory.add_to_rc('')
            # prepend brew for global installs
            if system.is_osx() and self.main_manifest.is_affirmative('config', 'use_global_packagemanagers'):
                self.directory.add_to_env('__sprinter_prepend_path "%s" PATH' % '/usr/local/bin')
            self.directory.add_to_env('__sprinter_prepend_path "%s" PATH' % self.directory.bin_path())
            self.directory.add_to_env('__sprinter_prepend_path "%s" LIBRARY_PATH' % self.directory.lib_path())
            self.directory.add_to_env('__sprinter_prepend_path "%s" C_INCLUDE_PATH' % self.directory.include_path())
            self.directory.finalize()

        self.injections.commit()
        self.global_injections.commit()

        if not os.path.exists(os.path.join(self.root, ".global")):
            self.logger.debug("Global directory doesn't exist! creating...")
            os.makedirs(os.path.join(self.root, ".global"))

        self.logger.debug("Writing shell util file...")
        with open(self.shell_util_path, 'w+') as fh:
            fh.write(shell_utils_template)

        if self.error_occured:
            raise SprinterException("Error occured!")

        if self.message_success():
            self.logger.info(self.message_success())

        self.logger.info("Done!")
        self.logger.info("NOTE: Please remember to open new shells/terminals to use the modified environment")
327456
def build(self, output_path=""):
        """"""

        self.output_path = self.checkOutputPath(output_path)
        self._buildStaticFiles()
        self.final_url = self._buildTemplates()
        printDebug("Done.", "comment")
        printDebug("=> %s" % (self.final_url), "comment")
        return self.final_url
1201742
private void processOperations(
            final Consumer<WorkflowSystem.OperationResult<DAT, RES, OP>> resultConsumer
    )
    {
        int origPendingCount = pending.size();

        //operations which match runnable conditions
        List<OP> shouldrun = pending.stream()
                                    .filter(input -> input.shouldRun(workflowEngine.getState()))
                                    .collect(Collectors.toList());

        //runnable that should be skipped
        List<OP> shouldskip = shouldrun.stream()
                                       .filter(input -> input.shouldSkip(workflowEngine.getState()))
                                       .collect(Collectors.toList());

        //shared data
        DAT inputData = null != sharedData ? sharedData.produceNext() : null;


        processRunnableOperations(resultConsumer, shouldrun, shouldskip, inputData);

        processSkippedOperations(shouldskip);

        pending.removeAll(shouldskip);
        skipped.addAll(shouldskip);

        workflowEngine.eventLoopProgress(origPendingCount, shouldskip.size(), shouldrun.size(), pending.size());
    }
133638
function consume_one (shared_ctx, self_ctx, cb) {
  if (shared_ctx.pop_count > shared_ctx.pop_max) {
    console.log ('pop consumer %s ended', self_ctx.id);
    shared_ctx.q.cancel ();
    return cb ();
  }

  shared_ctx.pop_count ++;
  self_ctx.pop_count ++;

  shared_ctx.q.pop (self_ctx.id, shared_ctx.pop_opts, (err, res) => {
    if (err) return cb (err);
    if ((shared_ctx.pop_count % 100000) == 0) console.log ('%s : consumed #%d elems', self_ctx.id, shared_ctx.pop_count);
    consume_one (shared_ctx, self_ctx, cb);
  });
}
920154
public void consumer(Class<?> api,
                        @Pin ServiceRefAmp serviceRef,
                        Result<? super Cancel> result)
  {
    String path = api.getName();
      
    String address = address(path);
      
    EventNodeAsset node = lookupPubSubNode(address);
      
    Cancel cancel = node.consumeImpl(serviceRef);
      
    result.ok(cancel);
  }
427850
private String asPath(String path, boolean generatedResource) {

		String result = path;
		if (!generatedResource) {
			result = PathNormalizer.asPath(path);
		}
		return result;
	}
127824
def _finalize(self):
        ""
        hobj = self._hobj
        for hashname in self._algorithms[1:]:
            fobj = hashlib.new(hashname)
            fobj.update(hobj.digest())
            hobj = fobj
        self._fobj = hobj
1117655
private void doFinish(String mavenHome, int mavenEclipseGoalType, int componentType, String artifactId, String groupId, String version, MuleVersionEnum muleVersion, List<TransportEnum> transports, DeploymentModelEnum deploymentModel, String folderName, IProgressMonitor monitor, String wsdlResource) throws CoreException {

		// create a sample folder
		monitor.beginTask("Starting the generator...", 3);

		// Create two print-streams one for each out and err (is written to in separated threads so we better create one stream per thread...)
		PrintStream out = page3.createStatusPrintStream();
		PrintStream err = page3.createStatusPrintStream();
		
		// Show status page
		getContainer().getShell().getDisplay().syncExec(
			new Runnable() {
				public void run() {
					getContainer().showPage(page3);
				}
			});
		
		monitor.worked(1);
		monitor.setTaskName("Generating files to folder: " + folderName);

		ComponentEnum compEnum = ComponentEnum.get(componentType);
		try {
			switch (compEnum) {
			case INTEGRATION_COMPONENT:
				new IntegrationComponentV2Generator(out, groupId, artifactId, version, muleVersion, deploymentModel, transports, folderName).startGenerator();
				break;

			case INTEGRATION_TESTSTUBS_COMPONENT:
				new IntegrationComponentTeststubGenerator(out, groupId, artifactId, version, deploymentModel, folderName).startGenerator();
				break;

			case SD_SCHEMA_COMPONENT:
				
				String schemaName = artifactId;
				List<String> operations = null;
				
				if (wsdlResource != null && wsdlResource.length() > 0) {
					new SchemaComponentGenerator(out, groupId, artifactId, version, schemaName, operations, folderName, wsdlResource).startGenerator();
				} else {
					new SchemaComponentGenerator(out, groupId, artifactId, version, schemaName, operations, folderName, null).startGenerator();
				}
				break;

			default:
				throw new RuntimeException("Unsupported component type: " + componentType);
			}

			String componentProjectName = getComponentProjectName(componentType, groupId, artifactId);
			final String path = folderName + "/" + componentProjectName;
			
//			int noOfFilesAndFoldersCreated = SystemUtil.countFiles(path);
			
			monitor.worked(1);
			// TODO issue #345: DataMapper support - we need to run the maven goal "studio:studio" here
			// hardcoded for now
			if (muleVersion.isEEVersion()) {
				err.println("issue #345: HARDCODED maven eclipse goal to studio:stduio for Mule-EE");
				mavenEclipseGoalType = MavenEclipseGoalEnum.MULESTUDIO_MULESTUDIO.ordinal();
			}
			
			String buildCommand = "mvn" + (SwtUtil.isWindows() ? ".bat" : "") + " install " + MavenEclipseGoalEnum.get(mavenEclipseGoalType).getLabel();

			monitor.setTaskName("Execute command: " + buildCommand);
			SystemUtil.executeCommand(mavenHome, buildCommand, path, out, err);
			
			monitor.worked(1);
			monitor.setTaskName("Open project(s) in " + path);

			
			switch (compEnum) {
			case INTEGRATION_COMPONENT:
				openProject(path + "/.project");
/*
				IModel m = ModelFactory.newModel(groupId, artifactId, null, null, null, null, null);

				openProject(path + "/" + m.getServiceProjectFilepath() + "/.project");
				
				if (deploymentModel == DeploymentModelEnum.STANDALONE_DEPLOY) {
					openProject(path + "/" + m.getStandaloneProjectFilepath() + "/.project");
					openProject(path + "/" + m.getTeststubStandaloneProjectFilepath() + "/.project");
				}

				if (deploymentModel == DeploymentModelEnum.WAR_DEPLOY) {
					openProject(path + "/" + m.getWebProjectFilepath() + "/.project");
					openProject(path + "/" + m.getTeststubWebProjectFilepath() + "/.project");
				}
*/
				break;

			case INTEGRATION_TESTSTUBS_COMPONENT:
				openProject(path + "/.project");
				break;

			case SD_SCHEMA_COMPONENT:
				openProject(path + "/.project");
				break;

			default:
				break;
			}


		} catch (IOException ioe) {
			throwCoreException("Failed to create a new component", ioe);
		}
		
		
//		getShell().getDisplay().asyncExec(new Runnable() {
//			public void run() {
//				IWorkbenchPage page =
//					PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
//				try {
//					IDE.openEditor(page, file, true);
//				} catch (PartInitException e) {
//				}
//			}
//		});
		monitor.worked(1);
	}
976220
def consume(self, routingKey, msg):
        
        builder_info = yield self.master.data.get(("builders", msg['builderid']))
        if self._builder_name_matches(builder_info):
            try:
                ret_val = self._callback(*self._retValParams(msg))
            except Exception as e:
                # catching generic exceptions is okay here since we propagate
                # it
                raise CaptureCallbackError("%s Exception raised: %s with message: %s" %
                                           (self._err_msg(msg, builder_info['name']),
                                            type(e).__name__, str(e)))

            context = self._defaultContext(msg, builder_info['name'])
            post_data = {
                self._time_type: ret_val
            }
            series_name = "%s-build-times" % builder_info['name']
            yield self._store(post_data, series_name, context)

        else:
            yield defer.succeed(None)
76225
def finalize(self):
        

        method = "finalize"

        A = None
        metadata = {method: -1}

        send_array(self.socket, A, metadata)
        A, metadata = recv_array(
            self.socket, poll=self.poll, poll_timeout=self.poll_timeout,
            flags=self.zmq_flags)
654716
def _generate_result(self, callname, result):
        """"""
        # Retrieve path from API class
        schema = self.api.result_schema()
        schema.context['callname'] = callname
        self.callback(schema.load(result), self.context)