Safe Haskell | None |
---|---|
Language | Haskell2010 |
Streams are the fundamental unit of organization of evented, service-oriented systems. They are both the storage and the transport of messages in message-based systems. And they are the principle storage medium of applicative entity data.
Streams are created by writing a message to the stream. Messages are appended to the end of streams. If the stream doesn't exist when an event is appended to it, the event will be appended at position 0. If the stream already exists, the event will be appended at the next position number.
Read more at: http://docs.eventide-project.org/core-concepts/streams
Synopsis
- newtype StreamName = StreamName {}
- data Category
- categoryOfStream :: StreamName -> Category
- categoryToText :: Category -> Text
- category :: Text -> Category
- newtype Identifier = Identifier {}
- identifierOfStream :: StreamName -> Maybe Identifier
- addIdentifierToCategory :: Category -> Identifier -> StreamName
- addMaybeIdentifierToCategory :: Category -> Maybe Identifier -> StreamName
Documentation
newtype StreamName Source #
Name of a stream. Look into categoryOfStream
or identifierOfStream
to parse out the category or identifier from the stream name.
StreamName | |
|
Instances
Category
A Category
represents everything in the StreamName
up to the first hyphen (-).
For example, the category for the stream name, "account-1234", is "account".
categoryOfStream :: StreamName -> Category Source #
Gets the category of a stream. For example for "account-123" it would return "account".
Identifier
newtype Identifier Source #
The identifier part of a stream name. Anything after the first hyphen (-).
Identifier | |
|
Instances
identifierOfStream :: StreamName -> Maybe Identifier Source #
Gets the identifier of a stream from a StreamName
.
For example "account-ed3b4af7-b4a0-499e-8a16-a09763811274" would return Just "ed3b4af7-b4a0-499e-8a16-a09763811274",
and "account" would return Nothing.
addIdentifierToCategory :: Category -> Identifier -> StreamName Source #
Add an identifier to a Category
.
For example category "account" and identifier "123" would return "account-123".
addMaybeIdentifierToCategory :: Category -> Maybe Identifier -> StreamName Source #
Add a maybe identifier, allowing you to add an identifier to the stream name if it is Just.