Skip to content

Simple CQRS multilang references implementation: Java, Go, Elixir, Swift, JavaScript (node.js), Clojure

Notifications You must be signed in to change notification settings

butaji/CommandAndQueries

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 

Repository files navigation

Simple CQRS example (polyglot edition)

This project inspired by Greg Young's project https://github.com/gregoryyoung/m-r where he's expaining simplest possible objects to keep in mind then you serve CQRS solution.

Implementations

Currently this project implemented in:

Every new language will be in another next branch and include very similar solution to problem .

Solution

In this section I will try to describe in pseudo-code how each solution is represented:

app = Application.new #it's application (our working horse to serve every routine work)

id = Id.new

app.send createTask id: id, title: "new title", version: -1

wait_while app.read_by_id(id).version == 0 #we need this because event publishing is asynchronous and everything happens in a while

app.send renameTask id: id, title: "new title 1", version: 0

wait_while app.read_by_id(id).version == 1

app.send completeTask id: id, version: 1

wait_while app.read_by_id(id).version == 2

task = app.read_by_id id

print "Check out that everything is ok with our task #{task.title} #{task.completed}"

About

Simple CQRS multilang references implementation: Java, Go, Elixir, Swift, JavaScript (node.js), Clojure

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published