#nitinol #in-memory #writer #nitinol-inmemory-adaptor

nitinol-inmemory-adaptor

In-memory storage adapter for nitinol-persistence

1 unstable release

0.1.0 Mar 25, 2025

#2 in #nitinol

24 downloads per month

MIT license

16KB
303 lines

nitinol-inmemory-adaptor

This is a simple adaptor to use Nitinol with inmemory database.

[!CAUTION]
This in-memory adapter loses data when the program is terminated. (of course)
It should only be used to test the library and do not be used into production.

Usage

#[tokio::main]
async fn main() {
    let eventstore = InMemoryEventStore::default();
    let writer = EventWriter::new(eventstore).set_retry(5);
    
    // Install as global writer.
    nitinol::setup::set_writer(writer);
}

Dependencies

~3–9.5MB
~85K SLoC