AuroraRuntime/Include/Aurora/Async/IWorkItemHandler.hpp
Reece 44108a322e 2/3 of the IO update (very early implementation)
[+] TTYConsole::GetPaddingTopOfLog,GetPaddingHeadOfLog,GetPaddingTopOfLog [+ set variants]
[+] IO::IOYield()
[+] IO::IAsyncTransaction::Failed,GetOSErrorCode()
[+] IByteBufferStreamPair
[+] IIOBufferedInterceptor
[+] IIOBufferedProcessor
[+] IIOEventListener
[+] IIOPipeEventListener
[+] IIOProcessorEventListener
[+] IIOProcessorManualInvoker
[+] IIOWaitableIOLoopSource
[+] IIOWaitableIOTimer
[+] IIOWaitableItem
[+] IIOWaitableTickLimiter
[+] IOAdapterAsyncStream
[+] IOAdapterByteBuffer
[+] IOAdapterCompression
[+] IOAdapterSeeking
[*] Cleanup CpuInfo.Linux.cpp
[*] Fixup async threadpool some more
[*] LSTimer.NT.cpp updates timer object on tick state update, akin to Linux
2022-06-12 00:01:27 +01:00

47 lines
1.3 KiB
C++

/***
Copyright (C) 2021 J Reece Wilson (a/k/a "Reece"). All rights reserved.
File: IWorkItemHandler.hpp
Date: 2021-11-1
Author: Reece
***/
#pragma once
namespace Aurora::Async
{
AUE_DEFINE(ETickType,
(
eFinished,
eRerun,
eSchedule,
eFailed
));
struct IWorkItemHandler
{
struct ProcessInfo
{
inline ProcessInfo(bool finished) : type(finished ? ETickType::eFinished : ETickType::eFailed) {}
inline ProcessInfo(ETickType type) : type(type) {}
inline ProcessInfo(const AuList<AuSPtr<IWorkItem>> &blockedBy) : type(ETickType::eSchedule), waitFor(blockedBy) {}
// ...
ETickType type;
AuList<AuSPtr<IWorkItem>> waitFor;
AuUInt32 reschedMs {};
AuUInt64 reschedNs {};
AuUInt32 reschedClockAbsMs {};
AuUInt64 reschedClockAbsNs {};
// @hideinitializer
IThreadPool *pool;
};
virtual void DispatchFrame(ProcessInfo &info) = 0;
/// A really terrible name for the overloadable method that serves as the critical failure callback
/// This may run from any thread
inline virtual void OnFailure() {};
inline virtual void *GetPrivateData() { return nullptr; }
};
}