aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/actors/interconnect/poller.h
blob: ce48d6f2cb6cb78dee0f81e23de9fe31d3c11d29 (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;
    };

}