void PosixProcess::ReadCallback(const ValueList& args, SharedValue result)
	{
		if (args.at(0)->IsObject())
		{
			AutoBlob blob = args.GetObject(0).cast<Blob>();
			if (!blob.isNull() && blob->Length() > 0)
			{
				Poco::Mutex::ScopedLock lock(processOutputMutex);
				processOutput.push_back(blob);
			}
		}
	}
	void NativePipe::PollForWriteIteration()
	{
		AutoBlob blob = 0;
		while (buffers.size() > 0)
		{
			{
				Poco::Mutex::ScopedLock lock(buffersMutex);
				blob = buffers.front();
				buffers.pop();
			}
			if (!blob.isNull())
			{
				this->RawWrite(blob);
				blob = 0;
			}
		}
	}
Example #3
0
	void Blob::Concat(const ValueList& args, SharedValue result)
	{
		std::vector<AutoBlob> blobs;
		for (size_t i = 0; i < args.size(); i++)
		{
			if (args.at(i)->IsObject())
			{
				AutoBlob blob = args.GetObject(i).cast<Blob>();
				if (!blob.isNull())
				{
					blobs.push_back(blob);
				}
			}
			else if (args.at(i)->IsString())
			{
				blobs.push_back(new Blob(args.GetString(i)));
			}
		}
		
		AutoBlob newBlob = this->Concat(blobs);
		result->SetObject(newBlob);
	}