Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for optional namespaces #12

Merged
merged 2 commits into from
Jun 26, 2018
Merged

Support for optional namespaces #12

merged 2 commits into from
Jun 26, 2018

Conversation

bilus
Copy link
Owner

@bilus bilus commented Jun 24, 2018

Overview

Optional namespacing for aggregate/projection streams and events allowing for isolation between different applications.

As a result, aggregates event listeners will load events generated within the namespace. If no namespace is provided, identical event or aggregate names may result in undefined behavior.

Usage

Akasha::Repository.new(store, namespace: 'myapp.example.com')

Implementation

If a namespace name is provided:

  1. Aggregate streams are prefixed with the namespace.
  2. Projection stream is prefixed with the namespace.
  3. Every event's metadata contains the namespace attribute containing the namespace name.
  4. Event listeners ignore events with a different namespace in their metadata.

Copy link
Collaborator

@hipek hipek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@brapacz
Copy link
Collaborator

brapacz commented Jun 25, 2018

LGTM, but version in change log is set to xx

// });
fromAll().when({ #{callbacks.join(', ')} });
"''
<<~JS
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not a big fan of Javascript hardcoded in Ruby files. Have you considered using ERB templates?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll create an issue about refactoring tasks.

@bilus bilus merged commit 89452fe into master Jun 26, 2018
@bilus bilus deleted the bilus/namespacing branch June 26, 2018 20:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants