19#ifndef CPPREALM_BRIDGE_SYNC_SESSION_HPP
20#define CPPREALM_BRIDGE_SYNC_SESSION_HPP
25#include <system_error>
29 namespace internal::bridge {
39 waiting_for_access_token,
43 enum class connection_state {
50 enum state state()
const;
53 enum connection_state connection_state()
const;
58 void wait_for_upload_completion(std::function<
void(
status)>&& callback);
62 void wait_for_download_completion(std::function<
void(
status)>&& callback);
67 std::future<void> wait_for_upload_completion();
70 std::future<void> wait_for_download_completion();
109 uint64_t
observe_connection_change(std::function<
void(
enum connection_state old_state,
enum connection_state new_state)>&& callback);
117 operator std::weak_ptr<SyncSession>();
119 std::weak_ptr<SyncSession> m_session;
Definition: status.hpp:63
Definition: sync_session.hpp:33
void resume()
Definition: sync_session.cpp:108
uint64_t observe_connection_change(std::function< void(enum connection_state old_state, enum connection_state new_state)> &&callback)
Definition: sync_session.cpp:124
void unregister_connection_change_observer(uint64_t token)
Definition: sync_session.cpp:134
void pause()
Definition: sync_session.cpp:100
void reconnect()
Definition: sync_session.cpp:116