#tinychain #transaction #executor

tc-transact

Traits and locking utilities for a TinyChain transaction

13 releases (7 breaking)

0.9.0 Oct 1, 2021
0.8.0 Aug 3, 2021
0.6.3 Jul 5, 2021
0.2.0 Mar 10, 2021

#109 in Concurrency

Download history 18/week @ 2021-06-30 7/week @ 2021-07-07 14/week @ 2021-07-14 32/week @ 2021-07-21 33/week @ 2021-07-28 44/week @ 2021-08-04 25/week @ 2021-08-11 3/week @ 2021-08-18 2/week @ 2021-08-25 15/week @ 2021-09-01 12/week @ 2021-09-08 11/week @ 2021-09-15 1/week @ 2021-09-22 31/week @ 2021-09-29 4/week @ 2021-10-06 27/week @ 2021-10-13

73 downloads per month
Used in 4 crates

Apache-2.0

145KB
4K SLoC

This crate is used internally by TinyChain. It provides traits and data structures to support transactional mutations of in-memory and persistent datatypes.

Example:

use tc_transact::{TxnId, TxnLock};

let version = TxnLock::new("version", 0);

let txn_one = TxnId::new(1);
let txn_two = TxnId::new(2);
let txn_three = TxnId::new(3);

assert_eq!(version.read(txn_one).await.unwrap(), 0);

*(version.write(txn_two).await.unwrap()) = 2;
version.commit(txn_two).await;

assert_eq!(version.read(txn_three).await.unwrap(), 2);

For more information on TinyChain, see http://github.com/haydnv/tinychain


lib.rs:

Provides traits and data structures to define a distributed transaction context.

This library is part of TinyChain: http://github.com/haydnv/tinychain

Dependencies

~9.5MB
~200K SLoC