Module: Igniter

Defined in:
lib/igniter.rb

Class Method Summary collapse

Class Method Details

.compile(&block) ⇒ Object



78
79
80
# File 'lib/igniter.rb', line 78

def compile(&block)
  DSL::ContractBuilder.compile(&block)
end

.compile_schema(schema, name: nil) ⇒ Object



82
83
84
# File 'lib/igniter.rb', line 82

def compile_schema(schema, name: nil)
  DSL::SchemaBuilder.compile(schema, name: name)
end

.configure {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:

  • _self (Igniter)

    the object that the method was called on



86
87
88
# File 'lib/igniter.rb', line 86

def configure
  yield self
end

.effect_registryObject



70
71
72
# File 'lib/igniter.rb', line 70

def effect_registry
  @effect_registry ||= EffectRegistry.new
end

.execution_storeObject



41
42
43
# File 'lib/igniter.rb', line 41

def execution_store
  @execution_store ||= Runtime::Stores::MemoryStore.new
end

.execution_store=(store) ⇒ Object



45
46
47
# File 'lib/igniter.rb', line 45

def execution_store=(store)
  @execution_store = store
end

.executor_registryObject



37
38
39
# File 'lib/igniter.rb', line 37

def executor_registry
  @executor_registry ||= ExecutorRegistry.new
end

.node_cacheObject

TTL cache backend for compute nodes. nil = disabled (default). Set to Igniter::NodeCache::Memory.new (or a Redis-backed equivalent).



51
52
53
# File 'lib/igniter.rb', line 51

def node_cache
  defined?(Igniter::NodeCache) ? Igniter::NodeCache.cache : nil
end

.node_cache=(cache) ⇒ Object



55
56
57
58
# File 'lib/igniter.rb', line 55

def node_cache=(cache)
  require "igniter/core/node_cache"
  Igniter::NodeCache.cache = cache
end

.node_coalescing=(enabled) ⇒ Object

When true, auto-creates a CoalescingLock alongside the configured node cache.



61
62
63
64
# File 'lib/igniter.rb', line 61

def node_coalescing=(enabled)
  require "igniter/core/node_cache"
  Igniter::NodeCache.coalescing_lock = enabled ? Igniter::NodeCache::CoalescingLock.new : nil
end

.register_effect(key, adapter_class, **metadata) ⇒ Object



74
75
76
# File 'lib/igniter.rb', line 74

def register_effect(key, adapter_class, **)
  effect_registry.register(key, adapter_class, **)
end

.register_executor(key, executor_class, **metadata) ⇒ Object



66
67
68
# File 'lib/igniter.rb', line 66

def register_executor(key, executor_class, **)
  executor_registry.register(key, executor_class, **)
end

.sdk_capabilitiesObject



33
34
35
# File 'lib/igniter.rb', line 33

def sdk_capabilities
  @sdk_capabilities ||= []
end

.use(*names) ⇒ Object



23
24
25
26
27
28
29
30
31
# File 'lib/igniter.rb', line 23

def use(*names)
  require "igniter/sdk"

  @sdk_capabilities ||= []
  resolved_names = names.flatten.map(&:to_sym)
  SDK.activate!(*resolved_names, layer: :core)
  @sdk_capabilities |= resolved_names
  self
end