summaryrefslogtreecommitdiff
path: root/include/erebos/sync.h
blob: 662a5588d14ab1bd7b3f86314564768a578d05f0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#pragma once

#include <erebos/service.h>
#include <erebos/state.h>
#include <erebos/storage.h>

#include <optional>
#include <mutex>
#include <vector>

namespace erebos {

using std::vector;

class SyncService : public Service
{
public:
	SyncService(Config &&, const Server &);
	virtual ~SyncService();

	UUID uuid() const override;
	void handle(Context &) override;

private:
	void peerWatcher(size_t, const class Peer *);
	void localStateWatcher(const vector<Ref> &);

	const Server & server;
	Watched<vector<Ref>> watchedLocal;
};

}