Skip to content

Commit e85f6b8

Browse files
authored
chore: Prepare for 0.1.0 release (#131)
1 parent f8897ca commit e85f6b8

33 files changed

+23
-1571
lines changed

.github/workflows/build-native-ext.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,8 @@ jobs:
1010
fail-fast: false
1111
matrix:
1212
ruby:
13-
# - 2.7.6
14-
- 3.0.4
15-
- 3.1.2
13+
- 3.0.5
14+
- 3.1.3
1615
os_arch:
1716
- ubuntu-x86
1817
- ubuntu-arm

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ jobs:
1414
fail-fast: true
1515
matrix:
1616
ruby:
17-
- 3.0.4
18-
- 3.1.2
17+
- 3.0.5
18+
- 3.1.3
1919
os:
2020
- ubuntu-latest
2121
- macos-latest

Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: .
33
specs:
4-
temporalio (0.0.2)
4+
temporalio (0.1.0)
55
async
66
google-protobuf (~> 3.21.1)
77
rexml (~> 3.2.5)

lib/temporalio.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
require 'temporalio/connection'
88
require 'temporalio/version'
99
require 'temporalio/worker'
10-
require 'temporalio/workflow'
1110

1211
module Temporalio
1312
end

lib/temporalio/interceptor.rb

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
require 'temporalio/interceptor/activity_inbound'
22
require 'temporalio/interceptor/activity_outbound'
3-
require 'temporalio/interceptor/workflow_inbound'
4-
require 'temporalio/interceptor/workflow_outbound'
53

64
module Temporalio
75
module Interceptor
@@ -14,10 +12,6 @@ def self.filter(interceptors, type)
1412
Temporalio::Interceptor::ActivityInbound
1513
when :activity_outbound
1614
Temporalio::Interceptor::ActivityOutbound
17-
when :workflow_inbound
18-
Temporalio::Interceptor::WorkflowInbound
19-
when :workflow_outbound
20-
Temporalio::Interceptor::WorkflowOutbound
2115
end
2216

2317
interceptors.each_with_object([]) do |i, result|

lib/temporalio/interceptor/workflow_inbound.rb

Lines changed: 0 additions & 22 deletions
This file was deleted.

lib/temporalio/interceptor/workflow_outbound.rb

Lines changed: 0 additions & 15 deletions
This file was deleted.

lib/temporalio/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module Temporalio
2-
VERSION = '0.0.2'.freeze
2+
VERSION = '0.1.0'.freeze
33
end

lib/temporalio/worker.rb

Lines changed: 10 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,9 @@
66
require 'temporalio/worker/runner'
77
require 'temporalio/worker/sync_worker'
88
require 'temporalio/worker/thread_pool_executor'
9-
require 'temporalio/worker/workflow_worker'
109

1110
module Temporalio
12-
# Worker to process workflows and/or activities.
11+
# Worker to process activities.
1312
#
1413
# Once created, workers can be run and shutdown explicitly via {#run} and {#shutdown}.
1514
class Worker
@@ -42,13 +41,12 @@ def self.run(*workers, shutdown_signals: [], &block)
4241
Runner.new(*workers).run(&block)
4342
end
4443

45-
# Create a worker to process workflows and/or activities.
44+
# Create a worker to process activities.
4645
#
4746
# @param connection [Temporalio::Connection] A connection to be used for this worker.
4847
# @param namespace [String] A namespace.
4948
# @param task_queue [String] A task queue.
5049
# @param activities [Array<Class>] A list of activities (subclasses of {Temporalio::Activity}).
51-
# @param workflows [Array<Class>] A list of workflows (subclasses of {Temporalio::Workflow}).
5250
# @param data_converter [Temporalio::DataConverter] Data converter to use for all data conversions
5351
# to/from payloads.
5452
# @param activity_executor [ThreadPoolExecutor] Concurrent executor for all activities. Defaults
@@ -60,17 +58,15 @@ def self.run(*workers, shutdown_signals: [], &block)
6058
# after a shutdown to complete before they are cancelled. A default value of `nil` means that
6159
# activities are never cancelled when handling a shutdown.
6260
#
63-
# @raise [ArgumentError] When no activities or workflows have been provided.
61+
# @raise [ArgumentError] When no activities have been provided.
6462
def initialize(
6563
connection,
6664
namespace,
6765
task_queue,
6866
activities: [],
69-
workflows: [],
7067
data_converter: Temporalio::DataConverter.new,
7168
activity_executor: nil,
7269
interceptors: [],
73-
max_cached_workflows: 1_000,
7470
max_concurrent_activities: 100,
7571
graceful_shutdown_timeout: nil
7672
)
@@ -84,7 +80,7 @@ def initialize(
8480
connection.core_connection,
8581
namespace,
8682
task_queue,
87-
max_cached_workflows,
83+
0, # maxCachedWorkflows disabled temporarily
8884
# FIXME: expose enable_non_local_activities
8985
activities.empty?,
9086
)
@@ -101,20 +97,9 @@ def initialize(
10197
graceful_shutdown_timeout,
10298
)
10399
end
104-
@workflow_worker =
105-
unless workflows.empty?
106-
Worker::WorkflowWorker.new(
107-
namespace,
108-
task_queue,
109-
sync_worker,
110-
workflows,
111-
data_converter,
112-
interceptors,
113-
)
114-
end
115100

116-
if !@activity_worker && !@workflow_worker
117-
raise ArgumentError, 'At least one activity or workflow must be specified'
101+
unless @activity_worker
102+
raise ArgumentError, 'At least one activity must be specified'
118103
end
119104
end
120105

@@ -127,9 +112,9 @@ def initialize(
127112
# run it again.
128113
#
129114
# @yield Optionally you can provide a block by the end of which the worker will shut itself
130-
# down. You can use this to stop a worker after some time has passed, your workflow has
131-
# finished or any other arbitrary implementation has completed. Any errors raised from this
132-
# block will be re-raised by this method.
115+
# down. You can use this to stop a worker after some time has passed or any other arbitrary
116+
# implementation has completed. Any errors raised from this block will be re-raised by this
117+
# method.
133118
def run(&block)
134119
Runner.new(self).run(&block)
135120
end
@@ -163,8 +148,6 @@ def start(runner = nil)
163148
shutdown(e) # initiate shutdown because of a fatal error
164149
end
165150
end
166-
167-
task.async { |task| workflow_worker.run(task) } if workflow_worker
168151
end
169152
end
170153

@@ -189,8 +172,6 @@ def shutdown(exception = Temporalio::Error::WorkerShutdown.new('Manual shutdown'
189172
activity_worker&.setup_graceful_shutdown_timer(runtime.reactor)
190173
# Wait for workers to drain any outstanding tasks
191174
activity_worker&.drain
192-
workflow_worker&.drain
193-
# Stop the executor (at this point there should already be nothing in it)
194175
activity_executor.shutdown
195176
# Finalize the shutdown by stopping the Core
196177
core_worker.finalize_shutdown
@@ -218,6 +199,6 @@ def running?
218199
private
219200

220201
attr_reader :mutex, :runtime, :activity_executor, :core_worker, :activity_worker,
221-
:workflow_worker, :runner
202+
:runner
222203
end
223204
end

0 commit comments

Comments
 (0)