Sonde v1.1.0
Embeddable Model Context Protocol server for Qt applications
Loading...
Searching...
No Matches
events.cpp File Reference

Event buffer, the event_read / event_wait tools and events:// resources. More...

#include "server_p.h"
#include "threadcheck_p.h"
#include <sonde/schema.h>
#include <QtCore/QJsonDocument>

Namespaces

namespace  Sonde
 Embeddable Model Context Protocol server for Qt applications.

Functions

static QString Sonde::resourceUriFor (const QString &sourceName)
 The events:// resource URI of a source.
bool & Sonde::anonymous_namespace{events.cpp}::inRecord ()
 Set while this thread is inside EventBuffer::record(): an event emitted from there (a warning from Qt, say) would deadlock on the buffer's mutex.
QJsonObject Sonde::anonymous_namespace{events.cpp}::filterProperties (const QStringList &sourceNames)
 The filter arguments shared by event_read and event_wait (sources limited to sourceNames).
int Sonde::anonymous_namespace{events.cpp}::limitArgument (const QJsonObject &args)
 The limit argument, bounded to 1..kMaxReadLimit.
ToolResult Sonde::anonymous_namespace{events.cpp}::waitResult (const QList< Event > &matched, quint64 lastSequence, int timeoutMs)
 The event_wait result for matched events (empty: timed out after timeoutMs).

Variables

static constexpr int Sonde::kDefaultReadLimit = 100
 Default number of events returned by event_read.
static constexpr int Sonde::kMaxReadLimit = 2000
 Upper bound for the limit argument.
static constexpr int Sonde::kDefaultWaitMs = 10000
 Default event_wait timeout.
static constexpr int Sonde::kMaxWaitMs = 300000
 Upper bound for the event_wait timeout.

Detailed Description

Event buffer, the event_read / event_wait tools and events:// resources.