solid_objects 0.1.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +22 -0
  3. data/README.md +160 -43
  4. data/app/models/solid_objects/claimed_message.rb +2 -0
  5. data/app/models/solid_objects/message.rb +6 -1
  6. data/benchmark/adoption_latency.rb +5 -0
  7. data/benchmark/support.rb +45 -15
  8. data/benchmark/{ask_latency.rb → sync_latency.rb} +1 -1
  9. data/db/migrate/20260805000000_create_solid_objects_tables.rb +15 -3
  10. data/docs/adr/0006-at-least-once-delivery.md +1 -1
  11. data/docs/adr/0008-actor-communication.md +4 -1
  12. data/docs/adr/0011-wake-up-strategy.md +13 -4
  13. data/docs/architecture.md +51 -20
  14. data/docs/authorization.md +85 -0
  15. data/docs/benchmarks.md +80 -10
  16. data/docs/correctness.md +28 -9
  17. data/docs/database-schema.md +15 -7
  18. data/docs/development.md +6 -5
  19. data/docs/fit.md +90 -0
  20. data/docs/implementation-plan.md +22 -16
  21. data/docs/migrating-existing-state.md +133 -0
  22. data/docs/operations.md +56 -4
  23. data/docs/research/solid_queue.md +2 -1
  24. data/docs/roadmap.md +9 -3
  25. data/docs/security.md +7 -2
  26. data/docs/state-migrations.md +4 -0
  27. data/lib/generators/solid_objects/templates/solid_objects.rb +17 -0
  28. data/lib/solid_objects/activation.rb +35 -19
  29. data/lib/solid_objects/activation_manager.rb +22 -6
  30. data/lib/solid_objects/actor.rb +16 -3
  31. data/lib/solid_objects/caller_process.rb +57 -0
  32. data/lib/solid_objects/client.rb +6 -37
  33. data/lib/solid_objects/configuration.rb +4 -4
  34. data/lib/solid_objects/doctor.rb +311 -0
  35. data/lib/solid_objects/engine.rb +1 -0
  36. data/lib/solid_objects/errors.rb +17 -1
  37. data/lib/solid_objects/executor.rb +42 -2
  38. data/lib/solid_objects/lease.rb +22 -10
  39. data/lib/solid_objects/message_reference.rb +1 -0
  40. data/lib/solid_objects/process_registry.rb +5 -1
  41. data/lib/solid_objects/reference.rb +8 -8
  42. data/lib/solid_objects/synchronous_invocation.rb +93 -0
  43. data/lib/solid_objects/version.rb +1 -1
  44. data/lib/solid_objects.rb +7 -0
  45. data/lib/tasks/solid_objects_tasks.rake +10 -0
  46. data/sig/generated/lib/solid_objects/activation.rbs +6 -0
  47. data/sig/generated/lib/solid_objects/activation_manager.rbs +6 -0
  48. data/sig/generated/lib/solid_objects/actor.rbs +9 -6
  49. data/sig/generated/lib/solid_objects/caller_process.rbs +32 -0
  50. data/sig/generated/lib/solid_objects/client.rbs +2 -8
  51. data/sig/generated/lib/solid_objects/configuration.rbs +2 -2
  52. data/sig/generated/lib/solid_objects/doctor.rbs +111 -0
  53. data/sig/generated/lib/solid_objects/errors.rbs +18 -1
  54. data/sig/generated/lib/solid_objects/executor.rbs +3 -0
  55. data/sig/generated/lib/solid_objects/lease.rbs +14 -10
  56. data/sig/generated/lib/solid_objects/reference.rbs +3 -3
  57. data/sig/generated/lib/solid_objects/synchronous_invocation.rbs +28 -0
  58. data/sig/generated/lib/solid_objects.rbs +3 -0
  59. data/sig/generated/models/solid_objects/message.rbs +3 -0
  60. metadata +15 -8
@@ -16,19 +16,20 @@ module SolidObjects
16
16
  freeze
17
17
  end
18
18
 
19
- # @rbs (Symbol | String, ?available_at: Time?, ?idempotency_key: String?, ?authorization_context: untyped, **untyped) -> (MessageReference | Actor::OutboundMessageIntent)
20
- def tell(message_name, available_at: nil, idempotency_key: nil, authorization_context: nil, **arguments)
19
+ # @rbs (Symbol | String, ?available_at: Time?, ?idempotency_key: String?, ?authorization_context: untyped, **untyped) -> MessageReference?
20
+ def async(message_name, available_at: nil, idempotency_key: nil, authorization_context: nil, **arguments)
21
21
  if (actor = Context.current_actor)
22
- return actor.stage_outbound_message(
22
+ actor.stage_outbound_message(
23
23
  self,
24
24
  message_name,
25
25
  arguments,
26
26
  available_at:,
27
27
  idempotency_key:
28
28
  )
29
+ return
29
30
  end
30
31
 
31
- SolidObjects.client.tell(
32
+ SolidObjects.client.async(
32
33
  self,
33
34
  message_name,
34
35
  arguments,
@@ -39,10 +40,10 @@ module SolidObjects
39
40
  end
40
41
 
41
42
  # @rbs (Symbol | String, ?timeout: Numeric, ?idempotency_key: String?, ?authorization_context: untyped, **untyped) -> untyped
42
- def ask(message_name, timeout: 5.seconds, idempotency_key: nil, authorization_context: nil, **arguments)
43
+ def sync(message_name, timeout: 5.seconds, idempotency_key: nil, authorization_context: nil, **arguments)
43
44
  raise ActorCallCycle, "actors cannot synchronously wait for another actor" if Context.current_actor
44
45
 
45
- SolidObjects.client.ask(
46
+ SolidObjects.client.sync(
46
47
  self,
47
48
  message_name,
48
49
  arguments,
@@ -60,8 +61,7 @@ module SolidObjects
60
61
  # @rbs (Symbol, *untyped, **untyped) -> untyped
61
62
  def method_missing(name, *arguments, **keywords)
62
63
  return super if arguments.any? || block_given?
63
- return tell(name, **keywords) if actor_message?(name)
64
- return Serialization.readonly_copy(ask(name, **keywords)) if actor_query?(name)
64
+ return sync(name, **keywords) if actor_message?(name) || actor_query?(name)
65
65
 
66
66
  super
67
67
  end
@@ -0,0 +1,93 @@
1
+ # rbs_inline: enabled
2
+
3
+ require "solid_objects/activation_manager"
4
+ require "solid_objects/lease_renewer"
5
+
6
+ module SolidObjects
7
+ class SynchronousInvocation
8
+ # @rbs (MessageReference, timeout: Numeric) -> untyped
9
+ def call(message_reference, timeout:)
10
+ deadline = monotonic_now + timeout.to_f
11
+
12
+ loop do
13
+ message = load_message(message_reference)
14
+ return completed_result(message) if message.completed? || message.dead?
15
+
16
+ remaining = deadline - monotonic_now
17
+ unless remaining.positive?
18
+ raise SyncTimeout, "actor invocation timed out after #{timeout} seconds"
19
+ end
20
+
21
+ processed = assist(message, deadline:)
22
+ wait(remaining) if processed.zero?
23
+ end
24
+ rescue ActiveRecord::RecordNotFound
25
+ raise ActorDestroyed, "actor was destroyed while waiting for its result"
26
+ end
27
+
28
+ private
29
+
30
+ # @rbs (MessageReference) -> Message
31
+ def load_message(message_reference)
32
+ Message.uncached { Message.find(message_reference.id) }
33
+ end
34
+
35
+ # @rbs (Message) -> untyped
36
+ def completed_result(message)
37
+ raise_rejection(message) if message.rejected?
38
+ if message.dead?
39
+ raise MessageFailed.new(
40
+ "actor message failed permanently",
41
+ message_id: message.id,
42
+ details: message.error || {}
43
+ )
44
+ end
45
+
46
+ Serialization.readonly_copy(message.result)
47
+ end
48
+
49
+ # @rbs (Message) -> bot
50
+ def raise_rejection(message)
51
+ rejection = message.rejection
52
+ raise Rejected.new(
53
+ code: rejection.fetch("code"),
54
+ message: rejection.fetch("message"),
55
+ details: rejection.fetch("details"),
56
+ message_id: message.id
57
+ )
58
+ end
59
+
60
+ # @rbs (Message, deadline: Float) -> Integer
61
+ def assist(message, deadline:)
62
+ process_registry = SolidObjects.caller_process.process_registry
63
+ activation = ActivationManager
64
+ .new(owner_id: process_registry.process_record.id)
65
+ .claim(instance_id: message.instance_id)
66
+ return 0 unless activation
67
+
68
+ LeaseRenewer.new(
69
+ activation:,
70
+ process_registry:
71
+ ).around do
72
+ activation.drain_until(message_id: message.id, deadline:)
73
+ end
74
+ ensure
75
+ if activation
76
+ activation.yield_ready_messages if activation.pass_exhausted?
77
+ activation.deactivate
78
+ end
79
+ end
80
+
81
+ # @rbs (Numeric) -> void
82
+ def wait(remaining)
83
+ SolidObjects.wake_up.wait(
84
+ timeout: [ remaining, SolidObjects.configuration.sync_polling_interval ].min
85
+ )
86
+ end
87
+
88
+ # @rbs () -> Float
89
+ def monotonic_now
90
+ ::Process.clock_gettime(::Process::CLOCK_MONOTONIC)
91
+ end
92
+ end
93
+ end
@@ -1,5 +1,5 @@
1
1
  # rbs_inline: enabled
2
2
 
3
3
  module SolidObjects
4
- VERSION = "0.1.0"
4
+ VERSION = "0.2.1"
5
5
  end
data/lib/solid_objects.rb CHANGED
@@ -78,6 +78,12 @@ module SolidObjects
78
78
  @client ||= Client.new
79
79
  end
80
80
 
81
+ # @rbs () -> CallerProcess
82
+ def caller_process
83
+ require "solid_objects/caller_process"
84
+ @caller_process ||= CallerProcess.new
85
+ end
86
+
81
87
  # @rbs () -> DeadLetterManager
82
88
  def dead_letters
83
89
  @dead_letters ||= DeadLetterManager.new
@@ -100,6 +106,7 @@ module SolidObjects
100
106
  @client = nil
101
107
  @database_adapter = nil
102
108
  @wake_up = nil
109
+ @caller_process = nil
103
110
  @effect_registry = EffectRegistry.new
104
111
  @dead_letters = nil
105
112
  end
@@ -0,0 +1,10 @@
1
+ require "solid_objects/doctor"
2
+
3
+ namespace :solid_objects do
4
+ desc "Verify the Solid Objects installation"
5
+ task doctor: :environment do
6
+ report = SolidObjects::Doctor.new.call
7
+ puts report
8
+ abort "Solid Objects doctor failed" unless report.healthy?
9
+ end
10
+ end
@@ -22,6 +22,9 @@ module SolidObjects
22
22
  # @rbs () -> Integer
23
23
  def drain: () -> Integer
24
24
 
25
+ # @rbs (message_id: Integer, deadline: Float) -> Integer
26
+ def drain_until: (message_id: Integer, deadline: Float) -> Integer
27
+
25
28
  # @rbs () -> bool
26
29
  def ready?: () -> bool
27
30
 
@@ -50,6 +53,9 @@ module SolidObjects
50
53
 
51
54
  attr_reader actor_class: untyped
52
55
 
56
+ # @rbs (?message_id: Integer?, ?deadline: Float?) -> Integer
57
+ def drain_messages: (?message_id: Integer?, ?deadline: Float?) -> Integer
58
+
53
59
  # @rbs (Instance) -> Actor
54
60
  def build_actor: (Instance) -> Actor
55
61
 
@@ -12,12 +12,18 @@ module SolidObjects
12
12
  # @rbs () -> Activation?
13
13
  def claim_next: () -> Activation?
14
14
 
15
+ # @rbs (instance_id: Integer) -> Activation?
16
+ def claim: (instance_id: Integer) -> Activation?
17
+
15
18
  private
16
19
 
17
20
  attr_reader owner_id: untyped
18
21
 
19
22
  attr_reader database_adapter: untyped
20
23
 
24
+ # @rbs (Array[Integer]) -> Activation?
25
+ def claim_from: (Array[Integer]) -> Activation?
26
+
21
27
  # @rbs (Time) -> Array[Integer]
22
28
  def candidate_instance_ids: (Time) -> Array[Integer]
23
29
 
@@ -130,14 +130,17 @@ module SolidObjects
130
130
  # @rbs () -> MessageContext?
131
131
  def current_message: () -> MessageContext?
132
132
 
133
- # @rbs (Symbol | String, ?on_success: Symbol | String?, ?on_failure: Symbol | String?, **untyped) -> EffectIntent
134
- def emit: (Symbol | String, ?on_success: Symbol | String?, ?on_failure: Symbol | String?, **untyped) -> EffectIntent
133
+ # @rbs (Symbol | String, String, ?details: Hash[String | Symbol, untyped]) -> bot
134
+ def reject: (Symbol | String, String, ?details: Hash[String | Symbol, untyped]) -> bot
135
135
 
136
- # @rbs (Symbol | String, at: Time, ?every: Numeric?, ?missed: Symbol | String, arguments: Hash[Symbol | String, untyped]) -> ReminderIntent
137
- def schedule: (Symbol | String, at: Time, arguments: Hash[Symbol | String, untyped], ?every: Numeric?, ?missed: Symbol | String) -> ReminderIntent
136
+ # @rbs (Symbol | String, ?on_success: Symbol | String?, ?on_failure: Symbol | String?, **untyped) -> nil
137
+ def emit: (Symbol | String, ?on_success: Symbol | String?, ?on_failure: Symbol | String?, **untyped) -> nil
138
138
 
139
- # @rbs (Reference, Symbol | String, ?available_at: Time?, ?idempotency_key: String?, **untyped) -> OutboundMessageIntent
140
- def send_to: (Reference, Symbol | String, ?available_at: Time?, ?idempotency_key: String?, **untyped) -> OutboundMessageIntent
139
+ # @rbs (Symbol | String, at: Time, ?every: Numeric?, ?missed: Symbol | String, arguments: Hash[Symbol | String, untyped]) -> nil
140
+ def schedule: (Symbol | String, at: Time, arguments: Hash[Symbol | String, untyped], ?every: Numeric?, ?missed: Symbol | String) -> nil
141
+
142
+ # @rbs (Reference, Symbol | String, ?available_at: Time?, ?idempotency_key: String?, **untyped) -> nil
143
+ def send_to: (Reference, Symbol | String, ?available_at: Time?, ?idempotency_key: String?, **untyped) -> nil
141
144
 
142
145
  # @rbs (Symbol | String, Hash[String, untyped]) -> untyped
143
146
  def invoke: (Symbol | String, Hash[String, untyped]) -> untyped
@@ -0,0 +1,32 @@
1
+ # Generated from lib/solid_objects/caller_process.rb with RBS::Inline
2
+
3
+ module SolidObjects
4
+ class CallerProcess
5
+ @mutex: Thread::Mutex
6
+
7
+ @process_id: Integer?
8
+
9
+ @registry: ProcessRegistry?
10
+
11
+ # @rbs () -> void
12
+ def initialize: () -> void
13
+
14
+ # @rbs () -> ProcessRegistry
15
+ def process_registry: () -> ProcessRegistry
16
+
17
+ private
18
+
19
+ attr_reader mutex: untyped
20
+
21
+ attr_reader registry: untyped
22
+
23
+ # @rbs () -> void
24
+ def reset_after_fork: () -> void
25
+
26
+ # @rbs () -> bool
27
+ def reusable_registry?: () -> bool
28
+
29
+ # @rbs () -> ProcessRegistry
30
+ def register: () -> ProcessRegistry
31
+ end
32
+ end
@@ -8,10 +8,10 @@ module SolidObjects
8
8
  def initialize: (?mailbox: Mailbox) -> void
9
9
 
10
10
  # @rbs (Reference, Symbol | String, Hash[Symbol | String, untyped], ?available_at: Time?, ?idempotency_key: String?, ?authorization_context: untyped) -> MessageReference
11
- def tell: (Reference, Symbol | String, Hash[Symbol | String, untyped], ?available_at: Time?, ?idempotency_key: String?, ?authorization_context: untyped) -> MessageReference
11
+ def async: (Reference, Symbol | String, Hash[Symbol | String, untyped], ?available_at: Time?, ?idempotency_key: String?, ?authorization_context: untyped) -> MessageReference
12
12
 
13
13
  # @rbs (Reference, Symbol | String, Hash[Symbol | String, untyped], timeout: Numeric, ?idempotency_key: String?, ?authorization_context: untyped) -> untyped
14
- def ask: (Reference, Symbol | String, Hash[Symbol | String, untyped], timeout: Numeric, ?idempotency_key: String?, ?authorization_context: untyped) -> untyped
14
+ def sync: (Reference, Symbol | String, Hash[Symbol | String, untyped], timeout: Numeric, ?idempotency_key: String?, ?authorization_context: untyped) -> untyped
15
15
 
16
16
  # @rbs (Reference, ?authorization_context: untyped) -> bool
17
17
  def destroy: (Reference, ?authorization_context: untyped) -> bool
@@ -25,11 +25,5 @@ module SolidObjects
25
25
 
26
26
  # @rbs (Reference, authorization_context: untyped) -> void
27
27
  def authorize_destroy!: (Reference, authorization_context: untyped) -> void
28
-
29
- # @rbs (MessageReference, timeout: Numeric) -> untyped
30
- def wait_for_result: (MessageReference, timeout: Numeric) -> untyped
31
-
32
- # @rbs () -> Float
33
- def monotonic_now: () -> Float
34
28
  end
35
29
  end
@@ -44,7 +44,7 @@ module SolidObjects
44
44
 
45
45
  @polling_interval: Float
46
46
 
47
- @ask_polling_interval: Float
47
+ @sync_polling_interval: Float
48
48
 
49
49
  @lease_duration: Float
50
50
 
@@ -70,7 +70,7 @@ module SolidObjects
70
70
 
71
71
  attr_accessor polling_interval: untyped
72
72
 
73
- attr_accessor ask_polling_interval: untyped
73
+ attr_accessor sync_polling_interval: untyped
74
74
 
75
75
  attr_accessor lease_duration: untyped
76
76
 
@@ -0,0 +1,111 @@
1
+ # Generated from lib/solid_objects/doctor.rb with RBS::Inline
2
+
3
+ module SolidObjects
4
+ class Doctor
5
+ class Check
6
+ @name: Symbol
7
+
8
+ @status: Symbol
9
+
10
+ @message: String
11
+
12
+ attr_reader name: untyped
13
+
14
+ attr_reader status: untyped
15
+
16
+ attr_reader message: untyped
17
+
18
+ # @rbs (name: Symbol, status: Symbol, message: String) -> void
19
+ def initialize: (name: Symbol, status: Symbol, message: String) -> void
20
+
21
+ # @rbs () -> bool
22
+ def failed?: () -> bool
23
+ end
24
+
25
+ class Report
26
+ @checks: Array[Check]
27
+
28
+ attr_reader checks: untyped
29
+
30
+ # @rbs (checks: Array[Check]) -> void
31
+ def initialize: (checks: Array[Check]) -> void
32
+
33
+ # @rbs () -> bool
34
+ def healthy?: () -> bool
35
+
36
+ # @rbs (Symbol) -> Check
37
+ def check: (Symbol) -> Check
38
+
39
+ # @rbs () -> String
40
+ def to_s: () -> String
41
+ end
42
+
43
+ EXPECTED_COLUMNS: untyped
44
+
45
+ class ProbeActor < Actor
46
+ # @rbs (value: String) -> String
47
+ def ping: (value: String) -> String
48
+ end
49
+
50
+ @configuration: Configuration
51
+
52
+ @connection: untyped
53
+
54
+ # @rbs (?connection: untyped, ?configuration: Configuration) -> void
55
+ def initialize: (?connection: untyped, ?configuration: Configuration) -> void
56
+
57
+ # @rbs () -> Report
58
+ def call: () -> Report
59
+
60
+ private
61
+
62
+ attr_reader connection: untyped
63
+
64
+ attr_reader configuration: untyped
65
+
66
+ # @rbs () -> Check
67
+ def check_configuration: () -> Check
68
+
69
+ # @rbs () -> Check
70
+ def check_schema: () -> Check
71
+
72
+ # @rbs () -> Check
73
+ def check_authorization: () -> Check
74
+
75
+ # @rbs () -> Check
76
+ def check_runtime: () -> Check
77
+
78
+ # @rbs () -> Check
79
+ def check_sync_round_trip: () -> Check
80
+
81
+ # @rbs (Check, Check) -> bool
82
+ def ready_for_round_trip?: (Check, Check) -> bool
83
+
84
+ # @rbs () -> Check
85
+ def skipped_runtime: () -> Check
86
+
87
+ # @rbs () -> Check
88
+ def skipped_round_trip: () -> Check
89
+
90
+ # @rbs () -> Hash[Symbol, Hash[Symbol, untyped]]
91
+ def policy_probes: () -> Hash[Symbol, Hash[Symbol, untyped]]
92
+
93
+ # @rbs () -> Array[String]
94
+ def expected_table_names: () -> Array[String]
95
+
96
+ # @rbs (Symbol, String) -> Check
97
+ def pass: (Symbol, String) -> Check
98
+
99
+ # @rbs (Symbol, String) -> Check
100
+ def info: (Symbol, String) -> Check
101
+
102
+ # @rbs (Symbol, String) -> Check
103
+ def warn_check: (Symbol, String) -> Check
104
+
105
+ # @rbs (Symbol, String) -> Check
106
+ def fail_check: (Symbol, String) -> Check
107
+
108
+ # @rbs (Symbol, String) -> Check
109
+ def skip: (Symbol, String) -> Check
110
+ end
111
+ end
@@ -40,7 +40,24 @@ module SolidObjects
40
40
  class ActorDestroyed < LostActivation
41
41
  end
42
42
 
43
- class AskTimeout < Error
43
+ class SyncTimeout < Error
44
+ end
45
+
46
+ class Rejected < Error
47
+ @code: String
48
+
49
+ @details: Hash[String, untyped]
50
+
51
+ @message_id: Integer?
52
+
53
+ attr_reader code: untyped
54
+
55
+ attr_reader details: untyped
56
+
57
+ attr_reader message_id: untyped
58
+
59
+ # @rbs (code: String | Symbol, message: String, ?details: Hash[String | Symbol, untyped], ?message_id: Integer?) -> void
60
+ def initialize: (code: String | Symbol, message: String, ?details: Hash[String | Symbol, untyped], ?message_id: Integer?) -> void
44
61
  end
45
62
 
46
63
  class MessageFailed < Error
@@ -45,6 +45,9 @@ module SolidObjects
45
45
  # @rbs (Exception) -> void
46
46
  def fail_message: (Exception) -> void
47
47
 
48
+ # @rbs (Rejected) -> void
49
+ def reject_message: (Rejected) -> void
50
+
48
51
  # @rbs () -> ClaimedMessage
49
52
  def matching_claim!: () -> ClaimedMessage
50
53
 
@@ -2,35 +2,39 @@
2
2
 
3
3
  module SolidObjects
4
4
  class Lease
5
- # @rbs (instance: Instance, owner_id: String, now: Time, ?duration: Numeric, database_adapter: DatabaseAdapter) -> Lease?
6
- def self.claim: (instance: Instance, owner_id: String, now: Time, database_adapter: DatabaseAdapter, ?duration: Numeric) -> Lease?
5
+ # @rbs (instance: Instance, owner_id: String, activation_token: String, now: Time, ?duration: Numeric, database_adapter: DatabaseAdapter) -> Lease?
6
+ def self.claim: (instance: Instance, owner_id: String, activation_token: String, now: Time, database_adapter: DatabaseAdapter, ?duration: Numeric) -> Lease?
7
7
 
8
- # @rbs (instance_id: Integer, owner_id: String, ?duration: Numeric, ?database_adapter: DatabaseAdapter) -> Lease?
9
- def self.acquire: (instance_id: Integer, owner_id: String, ?duration: Numeric, ?database_adapter: DatabaseAdapter) -> Lease?
8
+ # @rbs (instance_id: Integer, owner_id: String, ?activation_token: String, ?duration: Numeric, ?database_adapter: DatabaseAdapter) -> Lease?
9
+ def self.acquire: (instance_id: Integer, owner_id: String, ?activation_token: String, ?duration: Numeric, ?database_adapter: DatabaseAdapter) -> Lease?
10
10
 
11
11
  # @rbs (Instance, String, Time) -> bool
12
12
  private def self.held_by_another_live_owner?: (Instance, String, Time) -> bool
13
13
 
14
- @instance_id: Integer
14
+ @database_adapter: DatabaseAdapter
15
15
 
16
- @owner_id: String
16
+ @expires_at: Time
17
17
 
18
18
  @generation: Integer
19
19
 
20
- @expires_at: Time
20
+ @activation_token: String
21
21
 
22
- @database_adapter: DatabaseAdapter
22
+ @owner_id: String
23
+
24
+ @instance_id: Integer
23
25
 
24
26
  attr_reader instance_id: untyped
25
27
 
26
28
  attr_reader owner_id: untyped
27
29
 
30
+ attr_reader activation_token: untyped
31
+
28
32
  attr_reader generation: untyped
29
33
 
30
34
  attr_reader expires_at: untyped
31
35
 
32
- # @rbs (instance_id: Integer, owner_id: String, generation: Integer, expires_at: Time, database_adapter: DatabaseAdapter) -> void
33
- def initialize: (instance_id: Integer, owner_id: String, generation: Integer, expires_at: Time, database_adapter: DatabaseAdapter) -> void
36
+ # @rbs (instance_id: Integer, owner_id: String, activation_token: String, generation: Integer, expires_at: Time, database_adapter: DatabaseAdapter) -> void
37
+ def initialize: (instance_id: Integer, owner_id: String, activation_token: String, generation: Integer, expires_at: Time, database_adapter: DatabaseAdapter) -> void
34
38
 
35
39
  # @rbs (?duration: Numeric) -> Lease
36
40
  def renew: (?duration: Numeric) -> Lease
@@ -13,11 +13,11 @@ module SolidObjects
13
13
  # @rbs (actor_type: String, actor_id: String) -> void
14
14
  def initialize: (actor_type: String, actor_id: String) -> void
15
15
 
16
- # @rbs (Symbol | String, ?available_at: Time?, ?idempotency_key: String?, ?authorization_context: untyped, **untyped) -> (MessageReference | Actor::OutboundMessageIntent)
17
- def tell: (Symbol | String, ?available_at: Time?, ?idempotency_key: String?, ?authorization_context: untyped, **untyped) -> (MessageReference | Actor::OutboundMessageIntent)
16
+ # @rbs (Symbol | String, ?available_at: Time?, ?idempotency_key: String?, ?authorization_context: untyped, **untyped) -> MessageReference?
17
+ def async: (Symbol | String, ?available_at: Time?, ?idempotency_key: String?, ?authorization_context: untyped, **untyped) -> MessageReference?
18
18
 
19
19
  # @rbs (Symbol | String, ?timeout: Numeric, ?idempotency_key: String?, ?authorization_context: untyped, **untyped) -> untyped
20
- def ask: (Symbol | String, ?timeout: Numeric, ?idempotency_key: String?, ?authorization_context: untyped, **untyped) -> untyped
20
+ def sync: (Symbol | String, ?timeout: Numeric, ?idempotency_key: String?, ?authorization_context: untyped, **untyped) -> untyped
21
21
 
22
22
  # @rbs (?authorization_context: untyped) -> bool
23
23
  def destroy: (?authorization_context: untyped) -> bool
@@ -0,0 +1,28 @@
1
+ # Generated from lib/solid_objects/synchronous_invocation.rb with RBS::Inline
2
+
3
+ module SolidObjects
4
+ class SynchronousInvocation
5
+ # @rbs (MessageReference, timeout: Numeric) -> untyped
6
+ def call: (MessageReference, timeout: Numeric) -> untyped
7
+
8
+ private
9
+
10
+ # @rbs (MessageReference) -> Message
11
+ def load_message: (MessageReference) -> Message
12
+
13
+ # @rbs (Message) -> untyped
14
+ def completed_result: (Message) -> untyped
15
+
16
+ # @rbs (Message) -> bot
17
+ def raise_rejection: (Message) -> bot
18
+
19
+ # @rbs (Message, deadline: Float) -> Integer
20
+ def assist: (Message, deadline: Float) -> Integer
21
+
22
+ # @rbs (Numeric) -> void
23
+ def wait: (Numeric) -> void
24
+
25
+ # @rbs () -> Float
26
+ def monotonic_now: () -> Float
27
+ end
28
+ end
@@ -21,6 +21,9 @@ module SolidObjects
21
21
  # @rbs () -> Client
22
22
  def self.client: () -> Client
23
23
 
24
+ # @rbs () -> CallerProcess
25
+ def self.caller_process: () -> CallerProcess
26
+
24
27
  # @rbs () -> DeadLetterManager
25
28
  def self.dead_letters: () -> DeadLetterManager
26
29
 
@@ -11,6 +11,9 @@ module SolidObjects
11
11
  # @rbs () -> bool
12
12
  def completed?: () -> bool
13
13
 
14
+ # @rbs () -> bool
15
+ def rejected?: () -> bool
16
+
14
17
  # @rbs () -> bool
15
18
  def dead?: () -> bool
16
19