SushiHangover.RealmThread
An Action/Task Message Pump for running commands on a dedicated Realm thread.
Public Member Functions | Properties | List of all members
SushiHangover.RealmThread Class Reference

A Realm Action Pump More...

Inheritance diagram for SushiHangover.RealmThread:

Public Member Functions

 RealmThread (Realms.RealmConfigurationBase realmConfig)
 Initializes a new instance of the T:SushiHangover.RealmThread class. More...
 
 RealmThread (Realms.RealmConfigurationBase realmConfig, bool autoCommmit)
 Initializes a new instance of the T:SushiHangover.RealmThread class. More...
 
void BeginInvoke (Action< Realms.Realm > action)
 Invokes a 'Fire and Forget' Action on a dedicated Realm thread. More...
 
void Invoke (Action< Realms.Realm > action)
 Invoke the specified action on a dedicated Realm thread. More...
 
Task InvokeAsync (Func< Realms.Realm, Task > func)
 Invoke an Task on a dedicated Realm thread. More...
 
void BeginTransaction ()
 Begin a Realm transaction on this thread. More...
 
void CommitTransaction ()
 Commits the Realm transaction that is active on this thread. More...
 
void RollbackTransaction ()
 Rollbacks the Ream transaction that is active on this thread. More...
 
void Dispose ()
 Releases all resource used by the T:SushiHangover.RealmThread object. More...
 

Properties

bool InTransaction [get]
 Gets a value indicating whether this T:SushiHangover.RealmThread is in transaction. More...
 

Detailed Description

A Realm Action Pump

Constructor & Destructor Documentation

◆ RealmThread() [1/2]

SushiHangover.RealmThread.RealmThread ( Realms.RealmConfigurationBase  realmConfig)
inline

Initializes a new instance of the T:SushiHangover.RealmThread class.

Parameters
realmConfigRealmConfigurationBase

◆ RealmThread() [2/2]

SushiHangover.RealmThread.RealmThread ( Realms.RealmConfigurationBase  realmConfig,
bool  autoCommmit 
)
inline

Initializes a new instance of the T:SushiHangover.RealmThread class.

Parameters
realmConfigRealmConfigurationBase
autoCommmitIf set to true auto commmit open transaction on Dispose

Member Function Documentation

◆ BeginInvoke()

void SushiHangover.RealmThread.BeginInvoke ( Action< Realms.Realm >  action)
inline

Invokes a 'Fire and Forget' Action on a dedicated Realm thread.

Parameters
actionAction.

◆ BeginTransaction()

void SushiHangover.RealmThread.BeginTransaction ( )
inline

Begin a Realm transaction on this thread.

◆ CommitTransaction()

void SushiHangover.RealmThread.CommitTransaction ( )
inline

Commits the Realm transaction that is active on this thread.

◆ Dispose()

void SushiHangover.RealmThread.Dispose ( )
inline

Releases all resource used by the T:SushiHangover.RealmThread object.

Call Dispose when you are finished using the T:SushiHangover.RealmThread. The Dispose method leaves the T:SushiHangover.RealmThread in an unusable state. After calling Dispose, you must release all references to the T:SushiHangover.RealmThread so the garbage collector can reclaim the memory that the T:SushiHangover.RealmThread was occupying.

◆ Invoke()

void SushiHangover.RealmThread.Invoke ( Action< Realms.Realm >  action)
inline

Invoke the specified action on a dedicated Realm thread.

Parameters
actionAction.

◆ InvokeAsync()

Task SushiHangover.RealmThread.InvokeAsync ( Func< Realms.Realm, Task >  func)
inline

Invoke an Task on a dedicated Realm thread.

Returns
Task
Parameters
funcFunc.

◆ RollbackTransaction()

void SushiHangover.RealmThread.RollbackTransaction ( )
inline

Rollbacks the Ream transaction that is active on this thread.

Property Documentation

◆ InTransaction

bool SushiHangover.RealmThread.InTransaction
get

Gets a value indicating whether this T:SushiHangover.RealmThread is in transaction.

true if in transaction; otherwise, false.


The documentation for this class was generated from the following file: