AuroraRuntime/Include/Aurora/Async/IWorkItemHandler.hpp
Jamie Reece Wilson 8944d8bd16 [+] IAsyncTimer
[+] IAsyncTimerCallback
[+] ETickType.hpp
[+] EWorkPriority.hpp
[+] static IThreadPool::GetSelfIOProcessor()
[+] static IThreadPool::GetSelfIONetInterface()
[+] static IThreadPool::GetSelfIONetWorker()
[-] [Source/Async/]AsyncRunnable.hpp
[*] Begin encapsulating WorkerPId_t
[*] WorkerPId_t no longer take strong pointers to prevent leaks given that these identifiers are copied and kept alive everywhere
2023-12-07 09:20:23 +00:00

41 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
{
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 {};
AuUInt64 reschedSteadyClockAbsNs {};
AuSPtr<IO::Loop::ILoopSource> pLoopSource {};
// @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; }
};
}