forked from coinbase/temporal-ruby
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtemporal.rb
68 lines (57 loc) · 1.7 KB
/
temporal.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# Protoc wants all of its generated files on the LOAD_PATH
$LOAD_PATH << File.expand_path('./gen', __dir__)
require 'securerandom'
require 'forwardable'
require 'temporal/configuration'
require 'temporal/client'
require 'temporal/metrics'
require 'temporal/json'
require 'temporal/errors'
require 'temporal/workflow/errors'
module Temporal
extend SingleForwardable
def_delegators :default_client, #target
:start_workflow,
:schedule_workflow,
:register_namespace,
:describe_namespace,
:list_namespaces,
:signal_workflow,
:query_workflow,
:await_workflow_result,
:reset_workflow,
:terminate_workflow,
:fetch_workflow_execution_info,
:complete_activity,
:fail_activity,
:list_open_workflow_executions,
:list_closed_workflow_executions,
:query_workflow_executions,
:count_workflow_executions,
:add_custom_search_attributes,
:list_custom_search_attributes,
:remove_custom_search_attributes,
:connection
class << self
def configure(&block)
yield config
end
def configuration
warn '[DEPRECATION] This method is now deprecated without a substitution'
config
end
def logger
config.logger
end
def metrics
@metrics ||= Metrics.new(config.metrics_adapter)
end
private
def default_client
@default_client ||= Client.new(config)
end
def config
@config ||= Configuration.new
end
end
end