Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/reubenbond/orleanseventjournal
Simple calculator demonstrating a Web-based console & an Event Sourcing implementation for Project Orleans.
https://github.com/reubenbond/orleanseventjournal
actors c-sharp console demo event-sourcing http javascript journal orleans website
Last synced: 3 months ago
JSON representation
Simple calculator demonstrating a Web-based console & an Event Sourcing implementation for Project Orleans.
- Host: GitHub
- URL: https://github.com/reubenbond/orleanseventjournal
- Owner: ReubenBond
- License: mit
- Created: 2015-04-15T17:28:32.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2015-04-19T08:21:51.000Z (almost 10 years ago)
- Last Synced: 2024-05-02T00:13:12.655Z (9 months ago)
- Topics: actors, c-sharp, console, demo, event-sourcing, http, javascript, journal, orleans, website
- Language: C#
- Size: 5.65 MB
- Stars: 21
- Watchers: 4
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# OrleansEventJournal
Simple calculator demonstrating a Web-based console & an Event Sourcing implementation for Project Orleans.Repos without any explanation suck, so here goes.
This is a demo project, demonstrating some things which we've been developing.
## Console
The first thing it shows is a Web-based terminal for Orleans. The idea is that you can perform arbitrary operations on actors. The console uses runtime code generation to create an efficient interface with the actor system.In the console, type `to /` to change scope to a new actor - tab-completion helps you discover the actor type names. The names are derived from the actor interface name, by default. Use the `Actor` attribute to override actor names.
Only `Guid` ids are supported (i.e, actors deriving from `IGrainWithGuidKey`).Once an actor has been set using the `to` command, use tab-completion to discover the actor methods. An example might be `setDisplayName bob`, which would correspond to a `SetDisplayName(string name)` method on an actor. Command names can be overridden using the (poorly named) `Event` attribute. Complex commands (which require JSON object, for example) can be input using the `js` mode.
The console POSTs command to a very basic "invoke" endpoint (ASP.NET Web API self-hosted via OWIN). The demo avoids authentication and authorization. That stuff has been implemented in our private code, but didn't apply to the demo. You can still see some auth code in `console.js`.
## Event Sourcing
The other thing which we demonstrate here is a terse Event Sourcing API. The API is based around a single consumer-facing method with various overloads to handle async, etc:
```c#
protected Task Event(Action validate, Func emit, Action apply);
```The event sourcing API is conceptually explained in [this comment](https://github.com/dotnet/orleans/issues/343#issuecomment-94103353), where I've tried to clarify some misunderstandings and lay out the future plans.