Skip to content

Commit

Permalink
updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
andreabalducci committed Dec 19, 2017
1 parent b89be6f commit 5ad2f85
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 16 deletions.
19 changes: 8 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
<img src="logo/logo.png" alt="logo" height="120" align="right" />

# NStore
[<img src="https://ci.appveyor.com/api/projects/status/github/proximosrl/nstore?svg=true" alt="Project Badge" >](https://ci.appveyor.com/project/andreabalducci/nstore)
**(Yet Another) Opinionated Event Sourcing Library**


## Introduction
This project is a playground for experimenting with .net Standard, async and a simple API for a Sql/NoSql backed EventStore.

Heavily inspired from NEventStore, rewritten from scratch to be simple to learn and highly extensible.

## CI Status

| Build server | Platform | Build Status |
| ------------ | -------- | ------------ |
| AppVeyor | Windows | [<img src="https://ci.appveyor.com/api/projects/status/github/proximosrl/nstore?svg=true" alt="Build status" >](https://ci.appveyor.com/project/andreabalducci/nstore) |
| Travis | Ubuntu | [<img src="https://travis-ci.org/ProximoSrl/NStore.svg?branch=develop" alt="Build status" >](https://travis-ci.org/ProximoSrl/NStore) |

---
## Quickstart

### Streams API

var persister = CreateYourStore();
var persister = new InMemoryPersistence();
var streams = new StreamsFactory(persister);

// Write to stream
Expand All @@ -28,11 +30,6 @@ Heavily inspired from NEventStore, rewritten from scratch to be simple to learn
return Task.FromResult(true);
});

### Raw API

var persister = CreateYourStore();
await persister.AppendAsync("Stream_1", new { data = "Hello world!" });


---
## Learn
Expand Down
11 changes: 6 additions & 5 deletions src/NStore.Quickstart/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,24 +26,25 @@ private static async Task streams_api()

Console.WriteLine("Writing to Stream_1");
var stream = streams.Open("Stream_1");
await stream.AppendAsync(new { data = "Hello world!" });
await stream.AppendAsync(new { data = "Hello world!" }).ConfigureAwait(false);

Console.WriteLine("Reading from Stream_1");
await stream.ReadAsync(data => {
await stream.ReadAsync(data =>
{
Console.WriteLine($" index {data.Index} => {data.Payload}");
return Task.FromResult(true);
});
}).ConfigureAwait(false);
}

private static async Task raw_api()
{
var persister = CreateYourStore();
await persister.AppendAsync("Stream_1", new { data = "Hello world!" });
await persister.AppendAsync("Stream_1", new { data = "Hello world!" }).ConfigureAwait(false);
}

private static IPersistence CreateYourStore()
{
return new InMemoryPersistence(o => o);
return new InMemoryPersistence();
}
}
}

0 comments on commit 5ad2f85

Please sign in to comment.