LibCore: Add swift bindings for EventLoop as an Executor and Actor

This commit is contained in:
Andrew Kaster 2025-03-09 13:43:51 -06:00 committed by Andrew Kaster
commit c8787e6a9f
Notes: github-actions[bot] 2025-03-16 03:52:13 +00:00
10 changed files with 224 additions and 1 deletions

View file

@ -0,0 +1,22 @@
/*
* Copyright (c) 2025, Andrew Kaster <andrew@ladybird.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <LibCore/EventLoop.h>
#include <LibCore/EventSwift.h>
#if !__has_feature(objc_arc)
# error "This file requires ARC"
#endif
namespace Core {
void deferred_invoke_block(EventLoop& event_loop, void (^invokee)(void))
{
event_loop.deferred_invoke([invokee = move(invokee)] {
invokee();
});
}
}