1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 16:57:46 +00:00

LibCore: Slightly rework the Core::Promise API

The previous iteration of this API was somewhat odd and rough in random
places, which degraded usability and made less than perfect sense.
This commit reworks the API to be a little closer to more
conventional promise APIs (a la javascript promises).

Also adds a test to ensure the class even works.
This commit is contained in:
Ali Mohammad Pur 2023-07-08 01:30:27 +03:30 committed by Linus Groh
parent 5a0ad6812c
commit 0c5c75e8a4
9 changed files with 150 additions and 38 deletions

View file

@ -6,6 +6,8 @@
#pragma once
#include <AK/Forward.h>
namespace Core {
class AnonymousBuffer;
@ -32,7 +34,7 @@ class Object;
class ObjectClassRegistration;
class ProcessStatisticsReader;
class Socket;
template<typename Result>
template<typename Result, typename TError = AK::Error>
class Promise;
class SocketAddress;
class TCPServer;