Request

Response

    IMainThreadInvoker interface

    Enables asynchronous operations to be executed on the main thread of the host application. This interface must be implemented by the connector developer using host-specific APIs. It provides the UI Bridge with a way to schedule tasks that need to run on the host’s main thread - typically for operations like UI updates that require thread affinity.

    public interface IMainThreadInvoker
    

    Members

    namedescription
    InvokeAsync<T>(…) Executes an asynchronous operation on the main thread of the host application. The implementation of this method depends on the technology stack used by the host application. For example, WPF-based applications may use the Dispatcher for thread scheduling, while Windows Forms applications may use the Control.Invoke method.

    Remarks

    Many host environments require UI-related operations to be performed on the main thread to maintain thread safety. This interface allows the UI Bridge to schedule tasks that need to run on the main thread. Connector developers are responsible for implementing this interface using the appropriate threading mechanisms provided by their host application (e.g., dispatcher queues, thread management APIs, or synchronization contexts).

    See Also