[-] Theory crafted future AuProcesses API from yesteryear

This commit is contained in:
Reece Wilson 2023-07-13 06:29:41 +01:00
parent 115ee1a9ec
commit 6e59770eee
3 changed files with 0 additions and 54 deletions

View File

@ -1,9 +0,0 @@
/***
Copyright (C) 2022 J Reece Wilson (a/k/a "Reece"). All rights reserved.
File: ICommandFinished.hpp
Date: 2022-1-27
Author: Reece
***/
#pragma once

View File

@ -13,6 +13,5 @@
#include "IProcess.hpp"
#include "StartupParmaters.hpp"
#include "Spawn.hpp"
#include "UtilRun.hpp"
#include "Open.hpp"

View File

@ -1,44 +0,0 @@
/***
Copyright (C) 2022 J Reece Wilson (a/k/a "Reece"). All rights reserved.
File: UtilRun.hpp
Date: 2022-1-27
Author: Reece
***/
#pragma once
namespace Aurora::Processes
{
AUKN_INTERFACE(ICommandFinished,
AUI_METHOD(void, OnExit, (AuUInt32, exitCode))
);
AUKN_INTERFACE(IStdOutConsumer,
AUI_METHOD(void, OnLines, (const AuList<AuString> &, buffer)),
AUI_METHOD(void, OnBuffered, (const Memory::ByteBuffer &, buffer))
);
AUKN_INTERFACE(IStdInProvider,
AUI_METHOD(bool, OnLines, (AuList<AuString> &, buffer)),
AUI_METHOD(bool, OnBuffered, (Memory::ByteBuffer &, buffer))
);
struct CommandRun_s
{
AuString cmd;
AuList<AuString> args;
Memory::ByteBuffer startStdIn;
bool stdOutLongerThan64k {false}; // common constraint on linux and windows, at the very least. linux -> max pipe = 16k, windows -> 16k minimum guaranteed
bool stdOutIsText {true};
bool runCallbackOnRandomThread {true};
bool runCallbackOnWorkerPId {};
Async::WorkerPId_t worker;
bool syncToResult {}; // default -> async
AuSPtr<ICommandFinished> callback;
AuSPtr<IStdInProvider> stdInPoller;
AuSPtr<IStdOutConsumer> stdOutPoller;
AuSPtr<IStdOutConsumer> bufferAllStdout;
};
AUKN_SYM void RunCommand(const CommandRun_s &in);
}