This token processor adds support for transaction
statement. It
allows easy usage of transactions with any class that declares these methods:
begin
, commit
and rollback
. The statement
can contain any number of extra parameters, these are passed to the begin
method. This allows to customize the transaction behavior (for example by using
a read only transaction to allow concurrent read access).
use "io/transaction"; use "classes"; function test() { transaction (file) { // read/write transaction } transaction (file, false, 1000) { // read only transaction with timeout of 1000 ms } }