#nitinol #writer #set-writer

nitinol-inmemory-adaptor

In-memory storage adapter for nitinol-persistence

1 unstable release

new 0.1.0 Mar 25, 2025

#4 in #nitinol

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.5–10MB
~88K SLoC