#tinychain #transaction #executor

tc-transact

Traits and locking utilities for a TinyChain transaction

20 releases (13 breaking)

0.16.0 Jan 15, 2023
0.14.0 Sep 14, 2022
0.13.0 May 30, 2022
0.11.0 Feb 4, 2022
0.2.0 Mar 10, 2021

#166 in Concurrency

Download history 11/week @ 2022-11-30 34/week @ 2022-12-07 26/week @ 2022-12-14 21/week @ 2022-12-21 21/week @ 2022-12-28 4/week @ 2023-01-04 54/week @ 2023-01-11 25/week @ 2023-01-18 23/week @ 2023-01-25 45/week @ 2023-02-01 58/week @ 2023-02-08 129/week @ 2023-02-15 118/week @ 2023-02-22 10/week @ 2023-03-01 12/week @ 2023-03-08 12/week @ 2023-03-15

226 downloads per month
Used in 5 crates

Apache-2.0

265KB
6.5K 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–15MB
~274K SLoC