dfx 0.1.0
Linux-based dynamic dataflow executor
Loading...
Searching...
No Matches
Callback.hpp
1// SPDX-FileCopyrightText: 2025 Vincent Leroy
2// SPDX-License-Identifier: MIT
3//
4// This file is part of dfx.
5//
6// Licensed under the MIT License. See the LICENSE file in the project root
7// for full license information.
8
9#pragma once
10
11// Standard includes
12#include <functional>
13
14// Project includes
15#include "BorrowedFd.hpp"
16#include "Events.hpp"
17
18namespace dfx::FdWatch
19{
20// FdCallback has to remain std::function and not converted
21// to std::move_only_function because Runtime::Scheduler needs to be
22// able to copy it into Task
23
28using FdCallback = std::function<void (BorrowedFd, EventTriggers)>;
29
31using Callback = std::move_only_function<void ()>;
32} // !namespace dfx::FdWatch
Event interest and trigger flags for file-descriptor watching (Linux/epoll).
Non-owning wrapper around a file descriptor.
Definition BorrowedFd.hpp:37
Bitset wrapper for dfx::FdWatch::EventTrigger values.
Definition SocketClient.hpp:23
std::function< void(BorrowedFd, EventTriggers)> FdCallback
Invoked when events occur on a watched file descriptor.
Definition Callback.hpp:28
std::move_only_function< void()> Callback
Generic move-only callback with no arguments.
Definition Callback.hpp:31