summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibChess
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2023-04-23 20:59:32 +0200
committerAndreas Kling <kling@serenityos.org>2023-04-25 14:48:40 +0200
commit411d36719e8ee562bede1a6520891df4e43992f2 (patch)
treed4c0d4927bc2b4d1212756858fa3239ce80be5e0 /Userland/Libraries/LibChess
parent1587caef842c66ed382fc75c8f116d09ea7acc06 (diff)
downloadserenity-411d36719e8ee562bede1a6520891df4e43992f2.zip
LibCore: Simplify Core::Notifier by only allowing one event type
Not a single client of this API actually used the event mask feature to listen for readability AND writability. Let's simplify the API and have only one hook: on_activation.
Diffstat (limited to 'Userland/Libraries/LibChess')
-rw-r--r--Userland/Libraries/LibChess/UCIEndpoint.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/Userland/Libraries/LibChess/UCIEndpoint.cpp b/Userland/Libraries/LibChess/UCIEndpoint.cpp
index b2bbd7d692..3ab72461a2 100644
--- a/Userland/Libraries/LibChess/UCIEndpoint.cpp
+++ b/Userland/Libraries/LibChess/UCIEndpoint.cpp
@@ -15,7 +15,7 @@ namespace Chess::UCI {
Endpoint::Endpoint(NonnullRefPtr<Core::IODevice> in, NonnullRefPtr<Core::IODevice> out)
: m_in(in)
, m_out(out)
- , m_in_notifier(Core::Notifier::construct(in->fd(), Core::Notifier::Read))
+ , m_in_notifier(Core::Notifier::construct(in->fd(), Core::Notifier::Type::Read))
{
set_in_notifier();
}
@@ -70,8 +70,8 @@ void Endpoint::custom_event(Core::CustomEvent& custom_event)
void Endpoint::set_in_notifier()
{
- m_in_notifier = Core::Notifier::construct(m_in->fd(), Core::Notifier::Read);
- m_in_notifier->on_ready_to_read = [this] {
+ m_in_notifier = Core::Notifier::construct(m_in->fd(), Core::Notifier::Type::Read);
+ m_in_notifier->on_activation = [this] {
if (!m_in->can_read_line()) {
Core::EventLoop::current().post_event(*this, make<Core::CustomEvent>(EndpointEventType::UnexpectedEof));
m_in_notifier->set_enabled(false);