Module: Yes::Core::Commands::Stateless::Handler::RevisionsLoader

Defined in:
lib/yes/core/commands/stateless/handler.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#revisionsObject (readonly)

Returns the value of attribute revisions.



25
26
27
# File 'lib/yes/core/commands/stateless/handler.rb', line 25

def revisions
  @revisions
end

#subject_stream_revisionObject (readonly)

Returns the value of attribute subject_stream_revision.



25
26
27
# File 'lib/yes/core/commands/stateless/handler.rb', line 25

def subject_stream_revision
  @subject_stream_revision
end

Instance Method Details

#callObject



27
28
29
30
31
32
33
34
35
36
37
# File 'lib/yes/core/commands/stateless/handler.rb', line 27

def call
  transaction.otl_contexts.timestamps[:command_handling_started_at_ms] = (Time.now.utc.to_f * 1000).to_i if transaction&.otl_contexts

  if revision_check
    @subject_stream_revision = expected_revision(stream) || :no_stream
    @revisions = load_stream_revisions
  end

  # Here the business logic is checked
  super
end