Class: EventStoreClient::GRPC::Commands::Projections::Delete

Inherits:
Command
  • Object
show all
Defined in:
lib/event_store_client/adapters/grpc/commands/projections/delete.rb

Instance Method Summary collapse

Methods inherited from Command

inherited, #metadata

Methods included from Configuration

#config

Instance Method Details

#call(name, options: {}) ⇒ Object



17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/event_store_client/adapters/grpc/commands/projections/delete.rb', line 17

def call(name, options: {})
  opts = {
    name: name,
    delete_emitted_streams: true,
    delete_state_stream: true,
    delete_checkpoint_stream: true
  }.merge(options)

  service.delete(request.new(options: opts), metadata: )
  Success()
rescue ::GRPC::Unknown => e
  Failure(:not_found) if e.message.include?('OperationFailed')
end