#transaction #tiny-chain #executor #data-structures

tc-transact

Traits and locking utilities for a TinyChain transaction

24 releases (breaking)

0.20.0 Jan 29, 2024
0.19.0 Dec 20, 2023
0.18.0 Nov 6, 2023
0.16.0 Jan 15, 2023
0.2.0 Mar 10, 2021

#461 in Concurrency

Download history 27/week @ 2024-01-28 1/week @ 2024-02-04 3/week @ 2024-02-11 25/week @ 2024-02-18 53/week @ 2024-02-25 14/week @ 2024-03-03 20/week @ 2024-03-10 28/week @ 2024-03-17 9/week @ 2024-03-24 69/week @ 2024-03-31 66/week @ 2024-04-07 11/week @ 2024-04-14 16/week @ 2024-04-21 9/week @ 2024-04-28

114 downloads per month
Used in 10 crates

Apache-2.0

335KB
9K 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

~15–20MB
~395K SLoC