93using lib::RecursiveLock_Waitable;
94using std::make_unique;
112 ,
public Sync<RecursiveLock_Waitable>
115 using Launch = lib::ThreadHookable::Launch;
135 template<
typename FUN>
150 handle.detach_thread_from_wrapper();
168 ALERT (
session,
"Dispatcher destroyed while Session thread is running. The rest is silence.");
178 INFO (
command,
"Session command processing activated.");
187 INFO (
command,
"Session command interface closed.");
260 catch (std::exception&
problem)
276 ,[&]{ return looper_.requireAction(); });
290 if (
thread_.invokedWithinThread())
292 "Attempt to synchronise to a command processing check point "
293 "from within the (single) session thread."
294 , error::LUMIERA_ERROR_LIFECYCLE);
325 INFO (builder,
"+++ start the Steam-Builder...");
386 WARN (
command,
"clean-up of DispatcherLoop invoked, "
387 "while SteamDispatcher is not marked as 'running'. "
388 "Likely an error in lifecycle logic, as the only one "
389 "intended to delete this object is the loop thread itself.");
477 WARN (
command,
"DISCARDING pending Session commands.");
Configuration handle to expose a service implementation through the Depend<SRV> front-end.
IMP & createInstance(ARGS &&...ctorArgs)
Access point to singletons and other kinds of dependencies designated by type.
A one time N-fold mutual synchronisation barrier.
scoped guard to control the actual locking.
Facility for monitor object based locking.
static Monitor & getMonitor(Sync const *forThis)
Extended variant of the standard case, allowing to install callbacks (hook functions) to be invoked d...
void notify_all() noexcept
function< void(string *)> SigTerm
Interface of a service to perform Commands on the session.
Implementation of the Session's command queue.
CommandQueue & feed(Command &&cmd)
Handle object representing a single Command instance to be used by client code.
PImpl within SteamDispatcher to implement the Session Loop Thread.
void enqueue(Command &&cmd) override
void deactivateCommandProecssing()
DispatcherLoop(FUN &&atExit)
start the session loop thread
void runSessionThread()
any operation running in the Session thread is started from here.
lib::ThreadHookable::Launch Launch
bool isStateSynched() const
ServiceHandle commandService_
manage the primary public Session interface
void activateCommandProecssing()
void requestStop() noexcept
void awaitStateProcessed() const
Encapsulated control logic for the session thread loop.
void markStateProcessed()
invoking this function signals that all consequences of past state changes have been processed and ar...
milliseconds getTimeout() const
void enableProcessing(bool yes=true)
bool hasPendingChanges() const
< "check point"
bool shallLoop() const
state fusion to control looping
bool start(Subsys::SigTerm)
starting the SteamDispatcher means to start the session subsystem.
unique_ptr< DispatcherLoop > runningLoop_
bool isRunning()
whether the »session subsystem« is operational.
static lib::Depend< SteamDispatcher > instance
storage for Singleton access
void activate()
activate processing of enqueued session commands.
void deactivate()
halt further processing of session commands
void awaitDeactivation()
block until the dispatcher has actually reached disabled state.
void endRunningLoopState()
void clear()
discard any commands waiting in the dispatcher queue
void requestStop() noexcept
signal to the loop thread that it needs to terminate.
Interface to abstract the SteamDispatcher's ability to handle command messages.
Implementation building block of SteamDispatcher to organise commands.
Per type specific configuration of instances created as service dependencies.
lumiera_err lumiera_error(void)
Get and clear current error state.
Lumiera error handling (C++ interface).
#define ERROR_LOG_AND_IGNORE(_FLAG_, _OP_DESCR_)
convenience shortcut for a sequence of catch blocks just logging and consuming an error.
This header is for including and configuring NoBug.
Implementation building block of SteamDispatcher to control waiting and timing.
LumieraError< LERR_(FATAL), Logic > Fatal
Namespace of Session and user visible high-level objects.
Steam-Layer implementation namespace root.
bool startsWith(string const &str, string const &prefix)
check if string starts with a given prefix
A public service offered by the Session, implementing the SessionCommand facade interface.
Primary Interface to the current Session.
Dispatch and execute mutation operations on the High-level model.
CStr cStr(std::string const &rendered)
convenience shortcut: forced conversion to c-String via string.
A N-fold synchronisation latch using yield-wait until fulfilment.
Convenience front-end to simplify and codify basic thread handling.
Tiny helper functions and shortcuts to be used everywhere Consider this header to be effectively incl...