solid_objects 0.1.0
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.
- checksums.yaml +7 -0
- data/CHANGELOG.md +17 -0
- data/MIT-LICENSE +19 -0
- data/README.md +744 -0
- data/Rakefile +40 -0
- data/app/controllers/solid_objects/application_controller.rb +23 -0
- data/app/controllers/solid_objects/dead_letters_controller.rb +23 -0
- data/app/controllers/solid_objects/instances_controller.rb +29 -0
- data/app/helpers/solid_objects/actor_helper.rb +25 -0
- data/app/models/solid_objects/broadcast.rb +10 -0
- data/app/models/solid_objects/claimed_message.rb +14 -0
- data/app/models/solid_objects/dead_letter.rb +13 -0
- data/app/models/solid_objects/effect.rb +10 -0
- data/app/models/solid_objects/instance.rb +93 -0
- data/app/models/solid_objects/message.rb +53 -0
- data/app/models/solid_objects/process.rb +13 -0
- data/app/models/solid_objects/ready_message.rb +10 -0
- data/app/models/solid_objects/record.rb +17 -0
- data/app/models/solid_objects/reminder.rb +9 -0
- data/app/views/solid_objects/dead_letters/index.html.erb +26 -0
- data/app/views/solid_objects/instances/index.html.erb +24 -0
- data/app/views/solid_objects/instances/show.html.erb +35 -0
- data/benchmark/activation_cache.rb +5 -0
- data/benchmark/ask_latency.rb +5 -0
- data/benchmark/claim.rb +5 -0
- data/benchmark/cold_actors.rb +5 -0
- data/benchmark/concurrent_actors.rb +5 -0
- data/benchmark/enqueue.rb +5 -0
- data/benchmark/hot_actor.rb +5 -0
- data/benchmark/processing.rb +5 -0
- data/benchmark/query_count.rb +5 -0
- data/benchmark/support.rb +271 -0
- data/config/routes.rb +8 -0
- data/db/migrate/20260805000000_create_solid_objects_tables.rb +319 -0
- data/docs/adr/0001-postgresql-backend.md +21 -0
- data/docs/adr/0002-jsonb-actor-state.md +21 -0
- data/docs/adr/0003-mailbox-ordering.md +30 -0
- data/docs/adr/0004-activation-leasing.md +21 -0
- data/docs/adr/0005-fencing-tokens.md +25 -0
- data/docs/adr/0006-at-least-once-delivery.md +24 -0
- data/docs/adr/0007-transactional-outbox.md +21 -0
- data/docs/adr/0008-actor-communication.md +21 -0
- data/docs/adr/0009-realtime-updates.md +21 -0
- data/docs/adr/0010-state-versioning.md +29 -0
- data/docs/adr/0011-wake-up-strategy.md +34 -0
- data/docs/adr/0012-not-active-jobs.md +21 -0
- data/docs/adr/0013-database-adapters.md +48 -0
- data/docs/architecture.md +615 -0
- data/docs/benchmarks.md +26 -0
- data/docs/correctness.md +124 -0
- data/docs/database-schema.md +111 -0
- data/docs/development.md +87 -0
- data/docs/implementation-plan.md +518 -0
- data/docs/operations.md +123 -0
- data/docs/realtime.md +51 -0
- data/docs/research/solid_queue.md +545 -0
- data/docs/roadmap.md +53 -0
- data/docs/security.md +61 -0
- data/docs/state-migrations.md +46 -0
- data/examples/application/README.md +16 -0
- data/examples/application/app/actors/chat_room_actor.rb +34 -0
- data/examples/application/app/actors/shopping_cart_actor.rb +79 -0
- data/examples/application/app/controllers/cart_controller.rb +54 -0
- data/examples/application/app/controllers/chat_rooms_controller.rb +44 -0
- data/examples/application/app/views/actors/chat_room_actor/_messages.html.erb +8 -0
- data/examples/application/app/views/actors/shopping_cart_actor/_summary.html.erb +10 -0
- data/examples/application/app/views/cart/show.html.erb +13 -0
- data/examples/application/app/views/chat_rooms/show.html.erb +8 -0
- data/examples/application/config/initializers/solid_objects.rb +23 -0
- data/examples/application/config/routes.rb +20 -0
- data/exe/solid_objects +9 -0
- data/lib/generators/solid_objects/install_generator.rb +21 -0
- data/lib/generators/solid_objects/templates/solid_objects.rb +13 -0
- data/lib/solid_objects/action_cable_broadcast_adapter.rb +19 -0
- data/lib/solid_objects/activation.rb +183 -0
- data/lib/solid_objects/activation_manager.rb +102 -0
- data/lib/solid_objects/actor.rb +271 -0
- data/lib/solid_objects/actor_channel.rb +29 -0
- data/lib/solid_objects/actor_definition.rb +212 -0
- data/lib/solid_objects/actor_registry.rb +65 -0
- data/lib/solid_objects/actor_snapshot.rb +42 -0
- data/lib/solid_objects/actor_view.rb +117 -0
- data/lib/solid_objects/broadcast_executor.rb +162 -0
- data/lib/solid_objects/cli.rb +118 -0
- data/lib/solid_objects/client.rb +153 -0
- data/lib/solid_objects/configuration.rb +168 -0
- data/lib/solid_objects/context.rb +41 -0
- data/lib/solid_objects/database_adapter.rb +82 -0
- data/lib/solid_objects/database_adapters/mysql.rb +22 -0
- data/lib/solid_objects/database_adapters/postgresql.rb +17 -0
- data/lib/solid_objects/database_adapters/sqlite.rb +12 -0
- data/lib/solid_objects/dead_letter_manager.rb +47 -0
- data/lib/solid_objects/dom_identity.rb +38 -0
- data/lib/solid_objects/effect_executor.rb +235 -0
- data/lib/solid_objects/effect_registry.rb +34 -0
- data/lib/solid_objects/engine.rb +33 -0
- data/lib/solid_objects/errors.rb +65 -0
- data/lib/solid_objects/executor.rb +290 -0
- data/lib/solid_objects/instrumentation.rb +10 -0
- data/lib/solid_objects/lease.rb +172 -0
- data/lib/solid_objects/lease_renewer.rb +70 -0
- data/lib/solid_objects/log_subscriber.rb +29 -0
- data/lib/solid_objects/mailbox.rb +178 -0
- data/lib/solid_objects/message_reference.rb +52 -0
- data/lib/solid_objects/process_registry.rb +143 -0
- data/lib/solid_objects/reference.rb +96 -0
- data/lib/solid_objects/reminder_scheduler.rb +168 -0
- data/lib/solid_objects/serialization.rb +99 -0
- data/lib/solid_objects/state.rb +111 -0
- data/lib/solid_objects/stream_name.rb +29 -0
- data/lib/solid_objects/stream_token.rb +59 -0
- data/lib/solid_objects/supervisor.rb +87 -0
- data/lib/solid_objects/turbo_stream_renderer.rb +35 -0
- data/lib/solid_objects/version.rb +5 -0
- data/lib/solid_objects/wake_up.rb +28 -0
- data/lib/solid_objects/worker.rb +139 -0
- data/lib/solid_objects.rb +118 -0
- data/sig/generated/controllers/solid_objects/application_controller.rbs +10 -0
- data/sig/generated/controllers/solid_objects/dead_letters_controller.rbs +11 -0
- data/sig/generated/controllers/solid_objects/instances_controller.rbs +11 -0
- data/sig/generated/helpers/solid_objects/actor_helper.rbs +8 -0
- data/sig/generated/lib/generators/solid_objects/install_generator.rbs +13 -0
- data/sig/generated/lib/solid_objects/action_cable_broadcast_adapter.rbs +8 -0
- data/sig/generated/lib/solid_objects/activation.rbs +65 -0
- data/sig/generated/lib/solid_objects/activation_manager.rbs +36 -0
- data/sig/generated/lib/solid_objects/actor.rbs +183 -0
- data/sig/generated/lib/solid_objects/actor_channel.rbs +8 -0
- data/sig/generated/lib/solid_objects/actor_definition.rbs +117 -0
- data/sig/generated/lib/solid_objects/actor_registry.rbs +36 -0
- data/sig/generated/lib/solid_objects/actor_snapshot.rbs +28 -0
- data/sig/generated/lib/solid_objects/actor_view.rbs +56 -0
- data/sig/generated/lib/solid_objects/broadcast_executor.rbs +55 -0
- data/sig/generated/lib/solid_objects/cli.rbs +31 -0
- data/sig/generated/lib/solid_objects/client.rbs +35 -0
- data/sig/generated/lib/solid_objects/configuration.rbs +147 -0
- data/sig/generated/lib/solid_objects/context.rbs +56 -0
- data/sig/generated/lib/solid_objects/database_adapter.rbs +42 -0
- data/sig/generated/lib/solid_objects/database_adapters/mysql.rbs +16 -0
- data/sig/generated/lib/solid_objects/database_adapters/postgresql.rbs +13 -0
- data/sig/generated/lib/solid_objects/database_adapters/sqlite.rbs +10 -0
- data/sig/generated/lib/solid_objects/dead_letter_manager.rbs +16 -0
- data/sig/generated/lib/solid_objects/dom_identity.rbs +20 -0
- data/sig/generated/lib/solid_objects/effect_executor.rbs +82 -0
- data/sig/generated/lib/solid_objects/effect_registry.rbs +24 -0
- data/sig/generated/lib/solid_objects/engine.rbs +7 -0
- data/sig/generated/lib/solid_objects/errors.rbs +64 -0
- data/sig/generated/lib/solid_objects/executor.rbs +60 -0
- data/sig/generated/lib/solid_objects/instrumentation.rbs +8 -0
- data/sig/generated/lib/solid_objects/lease.rbs +57 -0
- data/sig/generated/lib/solid_objects/lease_renewer.rbs +42 -0
- data/sig/generated/lib/solid_objects/log_subscriber.rbs +11 -0
- data/sig/generated/lib/solid_objects/mailbox.rbs +46 -0
- data/sig/generated/lib/solid_objects/message_reference.rbs +37 -0
- data/sig/generated/lib/solid_objects/process_registry.rbs +46 -0
- data/sig/generated/lib/solid_objects/reference.rbs +45 -0
- data/sig/generated/lib/solid_objects/reminder_scheduler.rbs +55 -0
- data/sig/generated/lib/solid_objects/serialization.rbs +31 -0
- data/sig/generated/lib/solid_objects/state.rbs +72 -0
- data/sig/generated/lib/solid_objects/stream_name.rbs +11 -0
- data/sig/generated/lib/solid_objects/stream_token.rbs +19 -0
- data/sig/generated/lib/solid_objects/supervisor.rbs +38 -0
- data/sig/generated/lib/solid_objects/turbo_stream_renderer.rbs +14 -0
- data/sig/generated/lib/solid_objects/version.rbs +5 -0
- data/sig/generated/lib/solid_objects/wake_up.rbs +24 -0
- data/sig/generated/lib/solid_objects/worker.rbs +56 -0
- data/sig/generated/lib/solid_objects.rbs +41 -0
- data/sig/generated/models/solid_objects/broadcast.rbs +6 -0
- data/sig/generated/models/solid_objects/claimed_message.rbs +6 -0
- data/sig/generated/models/solid_objects/dead_letter.rbs +6 -0
- data/sig/generated/models/solid_objects/effect.rbs +6 -0
- data/sig/generated/models/solid_objects/instance.rbs +25 -0
- data/sig/generated/models/solid_objects/message.rbs +22 -0
- data/sig/generated/models/solid_objects/process.rbs +6 -0
- data/sig/generated/models/solid_objects/ready_message.rbs +6 -0
- data/sig/generated/models/solid_objects/record.rbs +8 -0
- data/sig/generated/models/solid_objects/reminder.rbs +6 -0
- data/sig/support/framework.rbs +37 -0
- metadata +467 -0
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# Generated from lib/solid_objects/executor.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module SolidObjects
|
|
4
|
+
class Executor
|
|
5
|
+
@message: Message
|
|
6
|
+
|
|
7
|
+
@activation: Activation
|
|
8
|
+
|
|
9
|
+
# @rbs (activation: Activation, message: Message) -> void
|
|
10
|
+
def initialize: (activation: Activation, message: Message) -> void
|
|
11
|
+
|
|
12
|
+
# @rbs () -> bool
|
|
13
|
+
def call: () -> bool
|
|
14
|
+
|
|
15
|
+
private
|
|
16
|
+
|
|
17
|
+
attr_reader activation: untyped
|
|
18
|
+
|
|
19
|
+
attr_reader message: untyped
|
|
20
|
+
|
|
21
|
+
# @rbs () -> Actor
|
|
22
|
+
def actor: () -> Actor
|
|
23
|
+
|
|
24
|
+
# @rbs (Hash[String, untyped]) -> void
|
|
25
|
+
def ensure_query_did_not_mutate_state!: (Hash[String, untyped]) -> void
|
|
26
|
+
|
|
27
|
+
# @rbs (Hash[String, untyped], Hash[String, untyped]) -> Hash[String, untyped]
|
|
28
|
+
def changed_observables: (Hash[String, untyped], Hash[String, untyped]) -> Hash[String, untyped]
|
|
29
|
+
|
|
30
|
+
# @rbs (untyped, Hash[String, untyped]) -> void
|
|
31
|
+
def complete: (untyped, Hash[String, untyped]) -> void
|
|
32
|
+
|
|
33
|
+
# @rbs (Message, Instance, Array[Actor::EffectIntent]) -> Array[Effect]
|
|
34
|
+
def enqueue_effects: (Message, Instance, Array[Actor::EffectIntent]) -> Array[Effect]
|
|
35
|
+
|
|
36
|
+
# @rbs (Instance, Array[Actor::ReminderIntent]) -> void
|
|
37
|
+
def schedule_reminders: (Instance, Array[Actor::ReminderIntent]) -> void
|
|
38
|
+
|
|
39
|
+
# @rbs (Message, Instance, Array[Actor::OutboundMessageIntent]) -> Array[Effect]
|
|
40
|
+
def enqueue_actor_messages: (Message, Instance, Array[Actor::OutboundMessageIntent]) -> Array[Effect]
|
|
41
|
+
|
|
42
|
+
# @rbs (Message, Instance, Hash[String, untyped]) -> void
|
|
43
|
+
def enqueue_broadcasts: (Message, Instance, Hash[String, untyped]) -> void
|
|
44
|
+
|
|
45
|
+
# @rbs (Exception) -> void
|
|
46
|
+
def fail_message: (Exception) -> void
|
|
47
|
+
|
|
48
|
+
# @rbs () -> ClaimedMessage
|
|
49
|
+
def matching_claim!: () -> ClaimedMessage
|
|
50
|
+
|
|
51
|
+
# @rbs (Exception) -> Hash[String, untyped]
|
|
52
|
+
def serialized_error: (Exception) -> Hash[String, untyped]
|
|
53
|
+
|
|
54
|
+
# @rbs (Message, Hash[String, untyped], Time) -> DeadLetter
|
|
55
|
+
def create_dead_letter: (Message, Hash[String, untyped], Time) -> DeadLetter
|
|
56
|
+
|
|
57
|
+
# @rbs () -> Hash[Symbol, untyped]
|
|
58
|
+
def instrumentation_payload: () -> Hash[Symbol, untyped]
|
|
59
|
+
end
|
|
60
|
+
end
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# Generated from lib/solid_objects/instrumentation.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module SolidObjects
|
|
4
|
+
module Instrumentation
|
|
5
|
+
# @rbs (Symbol, **untyped) { (Hash[Symbol, untyped]) -> untyped } -> untyped
|
|
6
|
+
def instrument: (Symbol, **untyped) { (Hash[Symbol, untyped]) -> untyped } -> untyped
|
|
7
|
+
end
|
|
8
|
+
end
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# Generated from lib/solid_objects/lease.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module SolidObjects
|
|
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?
|
|
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?
|
|
10
|
+
|
|
11
|
+
# @rbs (Instance, String, Time) -> bool
|
|
12
|
+
private def self.held_by_another_live_owner?: (Instance, String, Time) -> bool
|
|
13
|
+
|
|
14
|
+
@instance_id: Integer
|
|
15
|
+
|
|
16
|
+
@owner_id: String
|
|
17
|
+
|
|
18
|
+
@generation: Integer
|
|
19
|
+
|
|
20
|
+
@expires_at: Time
|
|
21
|
+
|
|
22
|
+
@database_adapter: DatabaseAdapter
|
|
23
|
+
|
|
24
|
+
attr_reader instance_id: untyped
|
|
25
|
+
|
|
26
|
+
attr_reader owner_id: untyped
|
|
27
|
+
|
|
28
|
+
attr_reader generation: untyped
|
|
29
|
+
|
|
30
|
+
attr_reader expires_at: untyped
|
|
31
|
+
|
|
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
|
|
34
|
+
|
|
35
|
+
# @rbs (?duration: Numeric) -> Lease
|
|
36
|
+
def renew: (?duration: Numeric) -> Lease
|
|
37
|
+
|
|
38
|
+
# @rbs () -> bool
|
|
39
|
+
def release: () -> bool
|
|
40
|
+
|
|
41
|
+
# @rbs () { (Instance) -> untyped } -> untyped
|
|
42
|
+
def fenced_transaction: () { (Instance) -> untyped } -> untyped
|
|
43
|
+
|
|
44
|
+
private
|
|
45
|
+
|
|
46
|
+
attr_reader database_adapter: untyped
|
|
47
|
+
|
|
48
|
+
# @rbs () -> Instance
|
|
49
|
+
def locked_owned_instance!: () -> Instance
|
|
50
|
+
|
|
51
|
+
# @rbs (Instance) -> bool
|
|
52
|
+
def owned_generation?: (Instance) -> bool
|
|
53
|
+
|
|
54
|
+
# @rbs (Instance, Time) -> void
|
|
55
|
+
def verify_unexpired!: (Instance, Time) -> void
|
|
56
|
+
end
|
|
57
|
+
end
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# Generated from lib/solid_objects/lease_renewer.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module SolidObjects
|
|
4
|
+
class LeaseRenewer
|
|
5
|
+
@activation: Activation
|
|
6
|
+
|
|
7
|
+
@process_registry: ProcessRegistry
|
|
8
|
+
|
|
9
|
+
@mutex: Thread::Mutex
|
|
10
|
+
|
|
11
|
+
@condition: Thread::ConditionVariable
|
|
12
|
+
|
|
13
|
+
@stopped: bool
|
|
14
|
+
|
|
15
|
+
@thread: Thread?
|
|
16
|
+
|
|
17
|
+
# @rbs (activation: Activation, process_registry: ProcessRegistry) -> void
|
|
18
|
+
def initialize: (activation: Activation, process_registry: ProcessRegistry) -> void
|
|
19
|
+
|
|
20
|
+
# @rbs () { () -> untyped } -> untyped
|
|
21
|
+
def around: () { () -> untyped } -> untyped
|
|
22
|
+
|
|
23
|
+
private
|
|
24
|
+
|
|
25
|
+
attr_reader activation: untyped
|
|
26
|
+
|
|
27
|
+
attr_reader process_registry: untyped
|
|
28
|
+
|
|
29
|
+
attr_reader mutex: untyped
|
|
30
|
+
|
|
31
|
+
attr_reader condition: untyped
|
|
32
|
+
|
|
33
|
+
# @rbs () -> void
|
|
34
|
+
def start: () -> void
|
|
35
|
+
|
|
36
|
+
# @rbs () -> bool
|
|
37
|
+
def wait_for_interval: () -> bool
|
|
38
|
+
|
|
39
|
+
# @rbs () -> void
|
|
40
|
+
def stop: () -> void
|
|
41
|
+
end
|
|
42
|
+
end
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Generated from lib/solid_objects/mailbox.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module SolidObjects
|
|
4
|
+
class Mailbox
|
|
5
|
+
INSTANCE_RETRY_LIMIT: ::Integer
|
|
6
|
+
|
|
7
|
+
@database_adapter: DatabaseAdapter
|
|
8
|
+
|
|
9
|
+
# @rbs (?database_adapter: DatabaseAdapter) -> void
|
|
10
|
+
def initialize: (?database_adapter: DatabaseAdapter) -> void
|
|
11
|
+
|
|
12
|
+
# @rbs (Reference, Symbol | String, Hash[Symbol | String, untyped], kind: String, ?available_at: Time?, idempotency_key: String?) -> MessageReference
|
|
13
|
+
def enqueue: (Reference, Symbol | String, Hash[Symbol | String, untyped], kind: String, idempotency_key: String?, ?available_at: Time?) -> MessageReference
|
|
14
|
+
|
|
15
|
+
# @rbs (Reference, Symbol | String, Hash[Symbol | String, untyped], kind: String, ?available_at: Time?, idempotency_key: String?, ?actor_class: Class?) -> Message
|
|
16
|
+
def enqueue_in_transaction: (Reference, Symbol | String, Hash[Symbol | String, untyped], kind: String, idempotency_key: String?, ?available_at: Time?, ?actor_class: Class?) -> Message
|
|
17
|
+
|
|
18
|
+
# @rbs (Message) -> void
|
|
19
|
+
def announce: (Message) -> void
|
|
20
|
+
|
|
21
|
+
private
|
|
22
|
+
|
|
23
|
+
attr_reader database_adapter: untyped
|
|
24
|
+
|
|
25
|
+
# @rbs () { () -> Message } -> Message
|
|
26
|
+
def with_instance_retry: () { () -> Message } -> Message
|
|
27
|
+
|
|
28
|
+
# @rbs (Reference, Class) -> Instance
|
|
29
|
+
def find_or_create_instance: (Reference, Class) -> Instance
|
|
30
|
+
|
|
31
|
+
# @rbs (Instance, String?) -> Message?
|
|
32
|
+
def find_idempotent_message: (Instance, String?) -> Message?
|
|
33
|
+
|
|
34
|
+
# @rbs (Message, Symbol | String, String, untyped) -> Message
|
|
35
|
+
def validate_idempotent_message!: (Message, Symbol | String, String, untyped) -> Message
|
|
36
|
+
|
|
37
|
+
# @rbs (Instance) -> void
|
|
38
|
+
def enforce_mailbox_limit!: (Instance) -> void
|
|
39
|
+
|
|
40
|
+
# @rbs (Instance, Reference, Symbol | String, untyped, kind: String, available_at: Time?, idempotency_key: String?) -> Message
|
|
41
|
+
def create_message: (Instance, Reference, Symbol | String, untyped, kind: String, available_at: Time?, idempotency_key: String?) -> Message
|
|
42
|
+
|
|
43
|
+
# @rbs (Time?, Time) -> Time
|
|
44
|
+
def normalize_availability: (Time?, Time) -> Time
|
|
45
|
+
end
|
|
46
|
+
end
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Generated from lib/solid_objects/message_reference.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module SolidObjects
|
|
4
|
+
class MessageReference
|
|
5
|
+
# @rbs (Message) -> MessageReference
|
|
6
|
+
def self.from_message: (Message) -> MessageReference
|
|
7
|
+
|
|
8
|
+
@id: Integer
|
|
9
|
+
|
|
10
|
+
@request_id: String
|
|
11
|
+
|
|
12
|
+
@actor_type: String
|
|
13
|
+
|
|
14
|
+
@actor_id: String
|
|
15
|
+
|
|
16
|
+
@sequence: Integer
|
|
17
|
+
|
|
18
|
+
attr_reader id: untyped
|
|
19
|
+
|
|
20
|
+
attr_reader request_id: untyped
|
|
21
|
+
|
|
22
|
+
attr_reader actor_type: untyped
|
|
23
|
+
|
|
24
|
+
attr_reader actor_id: untyped
|
|
25
|
+
|
|
26
|
+
attr_reader sequence: untyped
|
|
27
|
+
|
|
28
|
+
# @rbs (id: Integer, request_id: String, actor_type: String, actor_id: String, sequence: Integer) -> void
|
|
29
|
+
def initialize: (id: Integer, request_id: String, actor_type: String, actor_id: String, sequence: Integer) -> void
|
|
30
|
+
|
|
31
|
+
# @rbs () -> String
|
|
32
|
+
def status: () -> String
|
|
33
|
+
|
|
34
|
+
# @rbs () -> untyped
|
|
35
|
+
def result: () -> untyped
|
|
36
|
+
end
|
|
37
|
+
end
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Generated from lib/solid_objects/process_registry.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module SolidObjects
|
|
4
|
+
class ProcessRegistry
|
|
5
|
+
# @rbs (?now: Time) -> Integer
|
|
6
|
+
def self.cleanup_dead: (?now: Time) -> Integer
|
|
7
|
+
|
|
8
|
+
# @rbs (Process, ?now: Time) -> bool
|
|
9
|
+
def self.deregister: (Process, ?now: Time) -> bool
|
|
10
|
+
|
|
11
|
+
# @rbs (Process, Time) -> void
|
|
12
|
+
private def self.cleanup_process: (Process, Time) -> void
|
|
13
|
+
|
|
14
|
+
@process_record: Process?
|
|
15
|
+
|
|
16
|
+
@last_heartbeat_at: Float?
|
|
17
|
+
|
|
18
|
+
attr_reader process_record: untyped
|
|
19
|
+
|
|
20
|
+
# @rbs () -> void
|
|
21
|
+
def initialize: () -> void
|
|
22
|
+
|
|
23
|
+
# @rbs (?kind: String, ?metadata: Hash[String | Symbol, untyped]) -> Process
|
|
24
|
+
def register: (?kind: String, ?metadata: Hash[String | Symbol, untyped]) -> Process
|
|
25
|
+
|
|
26
|
+
# @rbs () -> bool
|
|
27
|
+
def heartbeat: () -> bool
|
|
28
|
+
|
|
29
|
+
# @rbs () -> bool
|
|
30
|
+
def start_draining: () -> bool
|
|
31
|
+
|
|
32
|
+
# @rbs () -> bool
|
|
33
|
+
def stop: () -> bool
|
|
34
|
+
|
|
35
|
+
private
|
|
36
|
+
|
|
37
|
+
# @rbs () -> Hash[Symbol, String]
|
|
38
|
+
def default_metadata: () -> Hash[Symbol, String]
|
|
39
|
+
|
|
40
|
+
# @rbs () -> bool
|
|
41
|
+
def heartbeat_recent?: () -> bool
|
|
42
|
+
|
|
43
|
+
# @rbs () -> Float
|
|
44
|
+
def monotonic_now: () -> Float
|
|
45
|
+
end
|
|
46
|
+
end
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# Generated from lib/solid_objects/reference.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module SolidObjects
|
|
4
|
+
class Reference
|
|
5
|
+
@actor_type: String
|
|
6
|
+
|
|
7
|
+
@actor_id: String
|
|
8
|
+
|
|
9
|
+
attr_reader actor_type: untyped
|
|
10
|
+
|
|
11
|
+
attr_reader actor_id: untyped
|
|
12
|
+
|
|
13
|
+
# @rbs (actor_type: String, actor_id: String) -> void
|
|
14
|
+
def initialize: (actor_type: String, actor_id: String) -> void
|
|
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)
|
|
18
|
+
|
|
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
|
|
21
|
+
|
|
22
|
+
# @rbs (?authorization_context: untyped) -> bool
|
|
23
|
+
def destroy: (?authorization_context: untyped) -> bool
|
|
24
|
+
|
|
25
|
+
# @rbs (Symbol, *untyped, **untyped) -> untyped
|
|
26
|
+
def method_missing: (Symbol, *untyped, **untyped) -> untyped
|
|
27
|
+
|
|
28
|
+
# @rbs (Symbol, bool) -> bool
|
|
29
|
+
def respond_to_missing?: (Symbol, bool) -> bool
|
|
30
|
+
|
|
31
|
+
# @rbs () -> String
|
|
32
|
+
def to_s: () -> String
|
|
33
|
+
|
|
34
|
+
private
|
|
35
|
+
|
|
36
|
+
# @rbs (Symbol | String) -> bool
|
|
37
|
+
def actor_message?: (Symbol | String) -> bool
|
|
38
|
+
|
|
39
|
+
# @rbs (Symbol | String) -> bool
|
|
40
|
+
def actor_query?: (Symbol | String) -> bool
|
|
41
|
+
|
|
42
|
+
# @rbs () -> ActorDefinition
|
|
43
|
+
def actor_definition: () -> ActorDefinition
|
|
44
|
+
end
|
|
45
|
+
end
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# Generated from lib/solid_objects/reminder_scheduler.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module SolidObjects
|
|
4
|
+
class ReminderScheduler
|
|
5
|
+
@shutdown_requested: bool
|
|
6
|
+
|
|
7
|
+
@stopped: bool
|
|
8
|
+
|
|
9
|
+
@database_adapter: DatabaseAdapter
|
|
10
|
+
|
|
11
|
+
@process_registry: ProcessRegistry
|
|
12
|
+
|
|
13
|
+
# @rbs (?process_registry: ProcessRegistry, ?database_adapter: DatabaseAdapter) -> void
|
|
14
|
+
def initialize: (?process_registry: ProcessRegistry, ?database_adapter: DatabaseAdapter) -> void
|
|
15
|
+
|
|
16
|
+
# @rbs () -> bool
|
|
17
|
+
def run_once: () -> bool
|
|
18
|
+
|
|
19
|
+
# @rbs () -> void
|
|
20
|
+
def stop: () -> void
|
|
21
|
+
|
|
22
|
+
# @rbs () -> void
|
|
23
|
+
def run: () -> void
|
|
24
|
+
|
|
25
|
+
# @rbs () -> void
|
|
26
|
+
def request_shutdown: () -> void
|
|
27
|
+
|
|
28
|
+
# @rbs () -> bool
|
|
29
|
+
def stopped?: () -> bool
|
|
30
|
+
|
|
31
|
+
# @rbs () -> bool
|
|
32
|
+
def shutdown_requested?: () -> bool
|
|
33
|
+
|
|
34
|
+
private
|
|
35
|
+
|
|
36
|
+
attr_reader process_registry: untyped
|
|
37
|
+
|
|
38
|
+
attr_reader database_adapter: untyped
|
|
39
|
+
|
|
40
|
+
# @rbs () -> Reminder?
|
|
41
|
+
def claim_next: () -> Reminder?
|
|
42
|
+
|
|
43
|
+
# @rbs (Reminder) -> MessageReference?
|
|
44
|
+
def enqueue: (Reminder) -> MessageReference?
|
|
45
|
+
|
|
46
|
+
# @rbs (Reminder) -> void
|
|
47
|
+
def release: (Reminder) -> void
|
|
48
|
+
|
|
49
|
+
# @rbs (Reminder) -> void
|
|
50
|
+
def verify_claim!: (Reminder) -> void
|
|
51
|
+
|
|
52
|
+
# @rbs (Reminder, Time) -> Time
|
|
53
|
+
def next_run_at: (Reminder, Time) -> Time
|
|
54
|
+
end
|
|
55
|
+
end
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Generated from lib/solid_objects/serialization.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module SolidObjects
|
|
4
|
+
module Serialization
|
|
5
|
+
MAX_NESTING: ::Integer
|
|
6
|
+
|
|
7
|
+
# @rbs (untyped, ?max_bytes: Integer?) -> untyped
|
|
8
|
+
def self.dump: (untyped, ?max_bytes: Integer?) -> untyped
|
|
9
|
+
|
|
10
|
+
# @rbs (untyped) -> untyped
|
|
11
|
+
def self.load: (untyped) -> untyped
|
|
12
|
+
|
|
13
|
+
# @rbs (untyped) -> untyped
|
|
14
|
+
def self.deep_copy: (untyped) -> untyped
|
|
15
|
+
|
|
16
|
+
# @rbs (untyped) -> untyped
|
|
17
|
+
def self.readonly_copy: (untyped) -> untyped
|
|
18
|
+
|
|
19
|
+
# @rbs (untyped) -> untyped
|
|
20
|
+
private def self.freeze_recursively: (untyped) -> untyped
|
|
21
|
+
|
|
22
|
+
# @rbs (untyped, ?depth: Integer) -> untyped
|
|
23
|
+
private def self.normalize: (untyped, ?depth: Integer) -> untyped
|
|
24
|
+
|
|
25
|
+
# @rbs (Hash[untyped, untyped], depth: Integer) -> Hash[String, untyped]
|
|
26
|
+
private def self.normalize_hash: (Hash[untyped, untyped], depth: Integer) -> Hash[String, untyped]
|
|
27
|
+
|
|
28
|
+
# @rbs (untyped) -> String
|
|
29
|
+
private def self.normalize_key: (untyped) -> String
|
|
30
|
+
end
|
|
31
|
+
end
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# Generated from lib/solid_objects/state.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module SolidObjects
|
|
4
|
+
class StateDefinition
|
|
5
|
+
class Attribute < Data
|
|
6
|
+
attr_reader name(): untyped
|
|
7
|
+
|
|
8
|
+
attr_reader default(): untyped
|
|
9
|
+
|
|
10
|
+
def self.new: (untyped name, untyped default) -> instance
|
|
11
|
+
| (name: untyped, default: untyped) -> instance
|
|
12
|
+
|
|
13
|
+
def self.members: () -> [ :name, :default ]
|
|
14
|
+
|
|
15
|
+
def members: () -> [ :name, :default ]
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
@attributes: Hash[Symbol, Attribute]
|
|
19
|
+
|
|
20
|
+
# @rbs () -> void
|
|
21
|
+
def initialize: () -> void
|
|
22
|
+
|
|
23
|
+
# @rbs (Symbol | String, ?default: untyped) -> Attribute
|
|
24
|
+
def attribute: (Symbol | String, ?default: untyped) -> Attribute
|
|
25
|
+
|
|
26
|
+
# @rbs () -> Hash[Symbol, Attribute]
|
|
27
|
+
def to_h: () -> Hash[Symbol, Attribute]
|
|
28
|
+
|
|
29
|
+
# @rbs () -> StateDefinition
|
|
30
|
+
def duplicate: () -> StateDefinition
|
|
31
|
+
|
|
32
|
+
private
|
|
33
|
+
|
|
34
|
+
attr_reader attributes: untyped
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
class State
|
|
38
|
+
@definition: StateDefinition
|
|
39
|
+
|
|
40
|
+
@data: Hash[String, untyped]
|
|
41
|
+
|
|
42
|
+
# @rbs (StateDefinition, Hash[String, untyped]?) -> void
|
|
43
|
+
def initialize: (StateDefinition, Hash[String, untyped]?) -> void
|
|
44
|
+
|
|
45
|
+
# @rbs () -> Hash[String, untyped]
|
|
46
|
+
def to_h: () -> Hash[String, untyped]
|
|
47
|
+
|
|
48
|
+
# @rbs (Symbol | String) -> untyped
|
|
49
|
+
def fetch: (Symbol | String) -> untyped
|
|
50
|
+
|
|
51
|
+
# @rbs (Symbol | String, untyped) -> untyped
|
|
52
|
+
def write: (Symbol | String, untyped) -> untyped
|
|
53
|
+
|
|
54
|
+
# @rbs (Symbol, *untyped) -> untyped
|
|
55
|
+
def method_missing: (Symbol, *untyped) -> untyped
|
|
56
|
+
|
|
57
|
+
# @rbs (Symbol, bool) -> bool
|
|
58
|
+
def respond_to_missing?: (Symbol, bool) -> bool
|
|
59
|
+
|
|
60
|
+
private
|
|
61
|
+
|
|
62
|
+
attr_reader definition: untyped
|
|
63
|
+
|
|
64
|
+
attr_reader data: untyped
|
|
65
|
+
|
|
66
|
+
# @rbs () -> void
|
|
67
|
+
def apply_defaults: () -> void
|
|
68
|
+
|
|
69
|
+
# @rbs (Symbol | String) -> bool
|
|
70
|
+
def defined_attribute?: (Symbol | String) -> bool
|
|
71
|
+
end
|
|
72
|
+
end
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Generated from lib/solid_objects/stream_name.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module SolidObjects
|
|
4
|
+
module StreamName
|
|
5
|
+
# @rbs (Reference | Hash[String, String]) -> String
|
|
6
|
+
def self?.for: (Reference | Hash[String, String]) -> String
|
|
7
|
+
|
|
8
|
+
# @rbs (Reference | Hash[String, String]) -> Hash[String, String]
|
|
9
|
+
def self?.identity_for: (Reference | Hash[String, String]) -> Hash[String, String]
|
|
10
|
+
end
|
|
11
|
+
end
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Generated from lib/solid_objects/stream_token.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module SolidObjects
|
|
4
|
+
module StreamToken
|
|
5
|
+
PURPOSE: ::String
|
|
6
|
+
|
|
7
|
+
# @rbs (Reference) -> String
|
|
8
|
+
def self?.generate: (Reference) -> String
|
|
9
|
+
|
|
10
|
+
# @rbs (String) -> Hash[String, String]
|
|
11
|
+
def self?.verify: (String) -> Hash[String, String]
|
|
12
|
+
|
|
13
|
+
# @rbs () -> ActiveSupport::MessageVerifier
|
|
14
|
+
def self?.verifier: () -> ActiveSupport::MessageVerifier
|
|
15
|
+
|
|
16
|
+
# @rbs () -> String
|
|
17
|
+
def self?.signing_secret: () -> String
|
|
18
|
+
end
|
|
19
|
+
end
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Generated from lib/solid_objects/supervisor.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module SolidObjects
|
|
4
|
+
class Supervisor
|
|
5
|
+
@components: Array[Worker | EffectExecutor | ReminderScheduler | BroadcastExecutor]
|
|
6
|
+
|
|
7
|
+
@threads: Array[Thread]
|
|
8
|
+
|
|
9
|
+
@started: bool
|
|
10
|
+
|
|
11
|
+
# @rbs (?worker_count: Integer, ?effect_worker_count: Integer, ?broadcast_worker_count: Integer, ?reminder_scheduler_count: Integer) -> void
|
|
12
|
+
def initialize: (?worker_count: Integer, ?effect_worker_count: Integer, ?broadcast_worker_count: Integer, ?reminder_scheduler_count: Integer) -> void
|
|
13
|
+
|
|
14
|
+
# @rbs () -> void
|
|
15
|
+
def run: () -> void
|
|
16
|
+
|
|
17
|
+
# @rbs () -> void
|
|
18
|
+
def start: () -> void
|
|
19
|
+
|
|
20
|
+
# @rbs () -> void
|
|
21
|
+
def stop: () -> void
|
|
22
|
+
|
|
23
|
+
private
|
|
24
|
+
|
|
25
|
+
attr_reader components: untyped
|
|
26
|
+
|
|
27
|
+
attr_reader threads: untyped
|
|
28
|
+
|
|
29
|
+
# @rbs (worker_count: Integer, effect_worker_count: Integer, broadcast_worker_count: Integer, reminder_scheduler_count: Integer) -> Array[Worker | EffectExecutor | ReminderScheduler | BroadcastExecutor]
|
|
30
|
+
def build_components: (worker_count: Integer, effect_worker_count: Integer, broadcast_worker_count: Integer, reminder_scheduler_count: Integer) -> Array[Worker | EffectExecutor | ReminderScheduler | BroadcastExecutor]
|
|
31
|
+
|
|
32
|
+
# @rbs () -> void
|
|
33
|
+
def join_until_timeout: () -> void
|
|
34
|
+
|
|
35
|
+
# @rbs () -> Float
|
|
36
|
+
def monotonic_now: () -> Float
|
|
37
|
+
end
|
|
38
|
+
end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Generated from lib/solid_objects/turbo_stream_renderer.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module SolidObjects
|
|
4
|
+
module TurboStreamRenderer
|
|
5
|
+
# @rbs (Broadcast) -> String
|
|
6
|
+
def self?.observable: (Broadcast) -> String
|
|
7
|
+
|
|
8
|
+
# @rbs (Reference, Symbol | String, untyped) -> String
|
|
9
|
+
def self?.observable_value: (Reference, Symbol | String, untyped) -> String
|
|
10
|
+
|
|
11
|
+
# @rbs (untyped) -> String
|
|
12
|
+
def self?.display_value: (untyped) -> String
|
|
13
|
+
end
|
|
14
|
+
end
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Generated from lib/solid_objects/wake_up.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module SolidObjects
|
|
4
|
+
class WakeUp
|
|
5
|
+
@mutex: Mutex
|
|
6
|
+
|
|
7
|
+
@condition: Thread::ConditionVariable
|
|
8
|
+
|
|
9
|
+
# @rbs () -> void
|
|
10
|
+
def initialize: () -> void
|
|
11
|
+
|
|
12
|
+
# @rbs () -> void
|
|
13
|
+
def signal: () -> void
|
|
14
|
+
|
|
15
|
+
# @rbs (timeout: Numeric) -> void
|
|
16
|
+
def wait: (timeout: Numeric) -> void
|
|
17
|
+
|
|
18
|
+
private
|
|
19
|
+
|
|
20
|
+
attr_reader mutex: untyped
|
|
21
|
+
|
|
22
|
+
attr_reader condition: untyped
|
|
23
|
+
end
|
|
24
|
+
end
|