RxSession
A Reactive session, which provides the same functionality as Session but through a Reactive API.
Method Summary
Public Methods | ||
public |
|
|
public |
beginTransaction(transactionConfig: TransactionConfig): Observable<RxTransaction> Starts a new explicit transaction with the provided transaction configuration. |
|
public |
close(): Observable Closes this reactive session. |
|
public |
executeRead(work: function(txc: RxManagedTransaction): Observable, transactionConfig: TransactionConfig): Observable Executes the provided unit of work in a READ reactive transaction which is created with the provided transaction configuration. |
|
public |
executeWrite(work: function(txc: RxManagedTransaction): Observable, transactionConfig: TransactionConfig): Observable Executes the provided unit of work in a WRITE reactive transaction which is created with the provided transaction configuration. |
|
public |
lastBookmarks(): string[] Returns the bookmarks received following the last successfully completed query, which is executed either in an RxTransaction obtained from this session instance or directly through one of the RxSession#run method of this session instance. |
|
public |
run(query: string, parameters: Object, transactionConfig: TransactionConfig): RxResult Creates a reactive result that will execute the query with the provided parameters and the provided transaction configuration that applies to the underlying auto-commit transaction. |
Public Methods
public [Symbol.asyncDispose]() source
public beginTransaction(transactionConfig: TransactionConfig): Observable<RxTransaction> source
Starts a new explicit transaction with the provided transaction configuration.
Params:
Name | Type | Attribute | Description |
transactionConfig | TransactionConfig | Configuration for the new transaction. |
Return:
Observable<RxTransaction> | A reactive stream that will generate at most one RxTransaction instance. |
public close(): Observable source
Closes this reactive session.
Return:
Observable | An empty reactive stream |
public executeRead(work: function(txc: RxManagedTransaction): Observable, transactionConfig: TransactionConfig): Observable source
Executes the provided unit of work in a READ reactive transaction which is created with the provided transaction configuration.
Params:
Name | Type | Attribute | Description |
work | function(txc: RxManagedTransaction): Observable | A unit of work to be executed. |
|
transactionConfig | TransactionConfig | Configuration for the enclosing transaction created by the driver. |
Return:
Observable | A reactive stream returned by the unit of work. |
public executeWrite(work: function(txc: RxManagedTransaction): Observable, transactionConfig: TransactionConfig): Observable source
Executes the provided unit of work in a WRITE reactive transaction which is created with the provided transaction configuration.
Params:
Name | Type | Attribute | Description |
work | function(txc: RxManagedTransaction): Observable | A unit of work to be executed. |
|
transactionConfig | TransactionConfig | Configuration for the enclosing transaction created by the driver. |
Return:
Observable | A reactive stream returned by the unit of work. |
public lastBookmarks(): string[] source
Returns the bookmarks received following the last successfully completed query, which is executed either in an RxTransaction obtained from this session instance or directly through one of the RxSession#run method of this session instance.
If no bookmarks were received or if this transaction was rolled back, the bookmarks value will not be changed.
Return:
string[] |
public run(query: string, parameters: Object, transactionConfig: TransactionConfig): RxResult source
Creates a reactive result that will execute the query with the provided parameters and the provided transaction configuration that applies to the underlying auto-commit transaction.
Params:
Name | Type | Attribute | Description |
query | string | Query to be executed. |
|
parameters | Object | Parameter values to use in query execution. |
|
transactionConfig | TransactionConfig | Configuration for the new auto-commit transaction. |