Class: CircuitBreaker::Executors::ServerlessExecutor

Inherits:
BaseExecutor
  • Object
show all
Defined in:
lib/circuit_breaker/executors/serverless_executor.rb

Instance Attribute Summary

Attributes inherited from BaseExecutor

#context, #result

Instance Method Summary collapse

Methods included from DSL

included, #validate_parameters

Constructor Details

#initialize(context = {}) ⇒ ServerlessExecutor

Returns a new instance of ServerlessExecutor.



6
7
8
9
10
11
# File 'lib/circuit_breaker/executors/serverless_executor.rb', line 6

def initialize(context = {})
  super
  @function_name = context[:function_name]
  @runtime = context[:runtime]
  @payload = context[:payload]
end

Instance Method Details

#executeObject



13
14
15
16
17
18
19
20
21
22
# File 'lib/circuit_breaker/executors/serverless_executor.rb', line 13

def execute
  # Implementation for serverless function execution would go here
  # This would typically involve invoking a serverless function
  @result = {
    function_name: @function_name,
    runtime: @runtime,
    payload: @payload,
    status: 'completed'
  }
end