Rill v0.10.4 Rill.Messaging.Message View Source
Link to this section Summary
Functions
Provides defstruct/1
macro which allows creation of struct with required
message keys (:id, :metadata)
Builds struct for struct_name
Builds struct for struct_name
Builds struct for struct_name
with correlation_stream_name
set
Behaves like defstruct/1
, but doesn't allow to use attributes named :id
or :metadata
(reserved).
The attribute :id
is automatically defined with default nil
.
The attribute :metadata
is automatically defined with default
%Rill.Messaging.Message.Metadata{}
Link to this section Types
copy_opts()
View Source
copy_opts() ::
{:metadata,
nil
| %Rill.Messaging.Message.Metadata{
causation_message_global_position: term(),
causation_message_position: term(),
causation_message_stream_name: term(),
correlation_stream_name: term(),
global_position: term(),
position: term(),
reply_stream_name: term(),
schema_version: term(),
stream_name: term(),
time: term()
}}
copy_opts() :: {:metadata, nil | %Rill.Messaging.Message.Metadata{ causation_message_global_position: term(), causation_message_position: term(), causation_message_stream_name: term(), correlation_stream_name: term(), global_position: term(), position: term(), reply_stream_name: term(), schema_version: term(), stream_name: term(), time: term() }}
message_or_type() View Source
Link to this section Functions
__using__(opts \\ []) View Source (macro)
Provides defstruct/1
macro which allows creation of struct with required
message keys (:id, :metadata)
build(struct_name, message_data) View Source
Builds struct for struct_name
build(struct_name, data \\ nil, metadata \\ nil) View Source
Builds struct for struct_name
build_metadata(metadata)
View Source
build_metadata(
metadata ::
%Rill.Messaging.Message.Metadata{
causation_message_global_position: term(),
causation_message_position: term(),
causation_message_stream_name: term(),
correlation_stream_name: term(),
global_position: term(),
position: term(),
reply_stream_name: term(),
schema_version: term(),
stream_name: term(),
time: term()
}
| nil
) :: %Rill.Messaging.Message.Metadata{
causation_message_global_position: term(),
causation_message_position: term(),
causation_message_stream_name: term(),
correlation_stream_name: term(),
global_position: term(),
position: term(),
reply_stream_name: term(),
schema_version: term(),
stream_name: term(),
time: term()
}
build_metadata( metadata :: %Rill.Messaging.Message.Metadata{ causation_message_global_position: term(), causation_message_position: term(), causation_message_stream_name: term(), correlation_stream_name: term(), global_position: term(), position: term(), reply_stream_name: term(), schema_version: term(), stream_name: term(), time: term() } | nil ) :: %Rill.Messaging.Message.Metadata{ causation_message_global_position: term(), causation_message_position: term(), causation_message_stream_name: term(), correlation_stream_name: term(), global_position: term(), position: term(), reply_stream_name: term(), schema_version: term(), stream_name: term(), time: term() }
canonize_name(name) View Source
copy(source, receiver, opts \\ []) View Source
correlate(struct_name, correlation_stream_name)
View Source
correlate(
struct_name :: module(),
correlation_stream_name :: Rill.MessageStore.StreamName.t()
) :: struct()
correlate(
message :: struct(),
correlation_stream_name :: Rill.MessageStore.StreamName.t()
) :: struct()
correlate( struct_name :: module(), correlation_stream_name :: Rill.MessageStore.StreamName.t() ) :: struct()
correlate( message :: struct(), correlation_stream_name :: Rill.MessageStore.StreamName.t() ) :: struct()
Builds struct for struct_name
with correlation_stream_name
set
defstruct(attrs) View Source (macro)
Behaves like defstruct/1
, but doesn't allow to use attributes named :id
or :metadata
(reserved).
The attribute :id
is automatically defined with default nil
.
The attribute :metadata
is automatically defined with default
%Rill.Messaging.Message.Metadata{}
follow(preceding_message, subsequent_message) View Source
follow(struct_name, preceding_message, subsequent_message) View Source
follows?(map1, map2)
View Source
follows?(
%{
metadata: %Rill.Messaging.Message.Metadata{
causation_message_global_position: term(),
causation_message_position: term(),
causation_message_stream_name: term(),
correlation_stream_name: term(),
global_position: term(),
position: term(),
reply_stream_name: term(),
schema_version: term(),
stream_name: term(),
time: term()
}
},
%{
metadata: %Rill.Messaging.Message.Metadata{
causation_message_global_position: term(),
causation_message_position: term(),
causation_message_stream_name: term(),
correlation_stream_name: term(),
global_position: term(),
position: term(),
reply_stream_name: term(),
schema_version: term(),
stream_name: term(),
time: term()
}
}
) :: boolean()
follows?( %{ metadata: %Rill.Messaging.Message.Metadata{ causation_message_global_position: term(), causation_message_position: term(), causation_message_stream_name: term(), correlation_stream_name: term(), global_position: term(), position: term(), reply_stream_name: term(), schema_version: term(), stream_name: term(), time: term() } }, %{ metadata: %Rill.Messaging.Message.Metadata{ causation_message_global_position: term(), causation_message_position: term(), causation_message_stream_name: term(), correlation_stream_name: term(), global_position: term(), position: term(), reply_stream_name: term(), schema_version: term(), stream_name: term(), time: term() } } ) :: boolean()
message_name(msg)
View Source
message_name(msg :: message_or_type()) :: String.t()
message_name(msg :: message_or_type()) :: String.t()
message_type(msg)
View Source
message_type(msg :: message_or_type()) :: [atom()]
message_type(msg :: message_or_type()) :: [atom()]
message_type?(msg, type)
View Source
message_type?(msg :: message_or_type(), type :: String.t()) :: boolean()
message_type?(msg :: message_or_type(), type :: String.t()) :: boolean()
struct_name(msg)
View Source
struct_name(msg :: message_or_type()) :: String.t()
struct_name(msg :: message_or_type()) :: String.t()
to_map(msg) View Source
transient_attributes()
View Source
transient_attributes() :: [atom()]
transient_attributes() :: [atom()]