AuroraRuntime/Source/Async/ThreadWorkerQueueShim.hpp
Reece Wilson f86665fd36 [+] Net: TCP servers can now be multi-threaded
[+] Net: Added missing UDP send datagram
[*] IO bug fixes
2022-11-17 20:58:48 +00:00

31 lines
1.0 KiB
C++

/***
Copyright (C) 2022 J Reece Wilson (a/k/a "Reece"). All rights reserved.
File: ThreadWorkerQueueShim.hpp
Date: 2022-3-9
Author: Reece
***/
#pragma once
#include <Source/IO/Loop/Loop.hpp>
#include <Source/IO/Loop/LoopQueue.hpp>
namespace Aurora::Async
{
struct AsyncLoop : AuLoop::LoopQueue
{
ThreadState *pParent;
void OnFrame();
virtual bool AddCallback (const AuSPtr<AuLoop::ILoopSource> &source, const AuSPtr<AuLoop::ILoopSourceSubscriber> &subscriber) override;
virtual bool AddCallbackEx(const AuSPtr<AuLoop::ILoopSource> &source, const AuSPtr<AuLoop::ILoopSourceSubscriberEx> &subscriber) override;
virtual bool AddCallback (const AuSPtr<AuLoop::ILoopSourceSubscriber> &subscriber) override;
virtual bool Commit () override;
void Schedule();
bool CommitPending();
private:
bool commitPending_ {};
};
}