aboutsummaryrefslogtreecommitdiff
path: root/mod/tenant-service.hxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2024-05-21 13:48:43 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2024-05-21 13:50:10 +0300
commitbad54b28bcc59fe5d19ecaf486f52e6359009e68 (patch)
tree4dcc9c10413d46bf9f506863b6f154ee5998e469 /mod/tenant-service.hxx
parentc4798955364d3a5e4074e56a0038148837c75d82 (diff)
Add support for build_unloaded() notification for tenant-associated services
Diffstat (limited to 'mod/tenant-service.hxx')
-rw-r--r--mod/tenant-service.hxx19
1 files changed, 18 insertions, 1 deletions
diff --git a/mod/tenant-service.hxx b/mod/tenant-service.hxx
index 9205f76..b7f5c02 100644
--- a/mod/tenant-service.hxx
+++ b/mod/tenant-service.hxx
@@ -21,7 +21,8 @@ namespace brep
virtual ~tenant_service_base () = default;
};
- // Possible build notifications:
+ // Possible build notifications (see also the unloaded special notification
+ // below):
//
// queued
// building
@@ -121,6 +122,22 @@ namespace brep
const diag_epilogue& log_writer) const noexcept = 0;
};
+ // This notification is only made on unloaded CI requests created with the
+ // ci_start::create() call and until they are loaded with ci_start::load()
+ // or, alternatively, abandoned with ci_start::abandon().
+ //
+ // Note: make sure the implementation of this notification does not take
+ // too long (currently 40 seconds) to avoid nested notifications. Note
+ // also that the first notification is delayed (currently 10 seconds).
+ //
+ class tenant_service_build_unloaded: public virtual tenant_service_base
+ {
+ public:
+ virtual function<optional<string> (const tenant_service&)>
+ build_unloaded (tenant_service&&,
+ const diag_epilogue& log_writer) const noexcept = 0;
+ };
+
// Map of service type (tenant_service::type) to service.
//
using tenant_service_map = std::map<string, shared_ptr<tenant_service_base>>;