aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/actors/interconnect/poller.h
blob: ff7979369f0b215b6cd01be829291162cb606f06 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#pragma once

#include <functional>
#include <library/cpp/actors/core/events.h>

namespace NActors {
    class TSharedDescriptor: public TThrRefBase {
    public:
        virtual int GetDescriptor() = 0;
    };

    using TDelegate = std::function<void()>;
    using TFDDelegate = std::function<TDelegate(const TIntrusivePtr<TSharedDescriptor>&)>;

    class IPoller: public TThrRefBase {
    public:
        virtual ~IPoller() = default;

        virtual void StartRead(const TIntrusivePtr<TSharedDescriptor>& s, TFDDelegate&& operation) = 0;
        virtual void StartWrite(const TIntrusivePtr<TSharedDescriptor>& s, TFDDelegate&& operation) = 0;
    };

}