summaryrefslogtreecommitdiff
path: root/src/service.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/service.cpp')
-rw-r--r--src/service.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/service.cpp b/src/service.cpp
index 14ff665..397bebd 100644
--- a/src/service.cpp
+++ b/src/service.cpp
@@ -34,6 +34,17 @@ void Service::Context::local(const LocalState & ls)
p->local = p->local.ref().storage().store(ls);
}
+void Service::Context::afterCommit(function<void()> hook)
+{
+ p->afterCommit.push_back(move(hook));
+}
+
+void Service::Context::runAfterCommitHooks() const
+{
+ for (const auto & hook : p->afterCommit)
+ hook();
+}
+
void Service::serverStarted(const class Server &)
{
}