Skip to content

Operations Framework: Diagrams

This page contains visual diagrams explaining how Operations Framework works.

High-Level Architecture

Command Execution Pipeline:

ClassDescription
NestedOperationLoggerCaptures nested command calls
InMemoryOperationScopeProviderProvides transient operation scope
DbOperationScopeProviderProvides DB-backed operation scope
InvalidatingCompletionHandlerRuns invalidation for completed operations

Background Services:

ClassDescription
DbOperationLogReaderReads operations from other hosts
DbOperationLogTrimmerRemoves old operations from log
DbEventLogReaderProcesses pending events
DbEventLogTrimmerRemoves processed/discarded events

Notification System:

ClassDescription
DbOperationCompletionNotifierTriggers invalidation for replayed operations
PostgreSqlDbLogWatcherListens for NOTIFY signals
RedisDbLogWatcherSubscribes to Redis pub/sub
FileSystemDbLogWatcherWatches for file changes

Command Execution Flow

HandlerPriorityResponsibility
NestedOperationLogger11,000Captures nested commands, isolates Operation.Items
InMemoryOperationScopeProvider10,000Transient scope, completion handling
DbOperationScopeProvider1,000DB transaction, operation persistence
InvalidatingCommandCompletionHandler100Runs invalidation pass

Operation Scope Lifecycle

Operation Items vs Context Items

PropertyCommandContext.ItemsOperation.Items
ScopeSingle command executionOperation + invalidation across all hosts
LifetimeCommand start → endCommand start → invalidation on all hosts
PersistenceIn-memory onlyStored in database (JSON)
Cross-hostNoYes
Usagecontext.Items.Set(...) / Get<T>()operation.Items.KeylessSet(x) / KeylessGet<T>()

Multi-Host Invalidation Flow

Event Processing Flow

Event StateDescription
NewFreshly added, awaiting processing
ProcessedSuccessfully executed
DiscardedFailed after max retries

Log Watcher Comparison

Watcher TypeMechanismLatencyInfrastructure
PostgreSQL NOTIFYNOTIFY / LISTEN on channel< 10msNone (uses DB)
Redis Pub/SubPUBLISH / SUBSCRIBE on channel< 1msRedis server
FileSystem WatcherTouch file / Watch directory< 100msShared filesystem
No Watcher (Polling)Poll _Operations table0-5sNone