Skip to content
ConsoleMonster
Class

AppDispatcher

ConsoleMonster.Interactive

Namespace
ConsoleMonster.Interactive
Assembly
ConsoleMonster
Implements
IDisposable
Modifiers
sealed

A bounded mailbox. Producers never execute UI callbacks; the app thread drains them with a per-tick budget.

Inheritance

  • object
  • AppDispatcher

Usage

Explore 2 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

Returned or exposed by 2

Constructors

public AppDispatcher(int capacity = 512) #

Creates a mailbox with an explicit finite capacity.

Parameters

capacity int = 512 optional

Methods

public void Dispose() #

Rejects future work and drops callbacks whose app no longer exists.

public int Drain(int budget = 64) #

Runs at most budget callbacks on the caller's app thread, outside the mailbox lock.

Parameters

budget int = 64 optional

Returns

int
public bool TryPost(Action callback) #

Attempts to queue a callback. Returns false when full or disposed.

Parameters

callback System.Action required

Returns

bool