#tinychain #transaction #executor

tc-transact

Traits and locking utilities for a TinyChain transaction

18 releases (11 breaking)

0.13.0 May 30, 2022
0.11.0 Feb 4, 2022
0.10.0 Dec 8, 2021
0.9.1 Nov 5, 2021
0.2.0 Mar 10, 2021

#90 in Concurrency

Download history 21/week @ 2022-03-03 19/week @ 2022-03-10 99/week @ 2022-03-17 2/week @ 2022-03-24 8/week @ 2022-03-31 37/week @ 2022-04-07 35/week @ 2022-04-14 8/week @ 2022-04-21 157/week @ 2022-04-28 135/week @ 2022-05-05 280/week @ 2022-05-12 82/week @ 2022-05-19 140/week @ 2022-05-26 154/week @ 2022-06-02 4/week @ 2022-06-09 14/week @ 2022-06-16

333 downloads per month
Used in 5 crates

Apache-2.0

150KB
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

~10MB
~202K SLoC