IObserver

The IObserver interface represents an observer that continues to respond to new facts after a Watch or Subscribe operation is initiated. It allows for controlling the observation of facts in a Jinaga system.

Properties

Cached

Task<bool> Cached { get; }

Await this task to pause until the results are loaded from local storage. Indicates whether the results were present.

Returns:

  • true if the results were retrieved from the local cache, otherwise false.

Description:

This property is useful to determine if the facts being observed were already stored locally or if they were fetched from a remote source.

Loaded

Task Loaded { get; }

A task that resolves when the results have been loaded from the remote replicator.

Returns:

  • A Task that is completed when the results have been fully loaded from the remote server.

Description:

This property is useful to track when remote data is available for the observer, ensuring that the observation is updated with the latest data from the replicator.

Methods

Refresh

Task Refresh(CancellationToken? cancellationToken = null)

Checks the replicator for new facts and updates the observer with any changes.

Parameters:

  • cancellationToken: (Optional) A CancellationToken to cancel the operation if needed.

Returns:

  • A Task that is completed once the observer has been updated with new facts from the replicator.

Description:

This method is used to force the observer to check the remote replicator for new facts and refresh its data accordingly.

Stop

void Stop()

Stops updating the results and removes the observer.

Description:

Call this method when unloading a view model or when the observer is no longer needed. It stops the observer from receiving further updates and frees up resources.

Continue With

JinagaClientOptions

Jinaga is a product of Jinaga LLC.

Michael L Perry, President