solid_objects 0.2.1 → 0.4.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 +4 -4
- data/CHANGELOG.md +24 -0
- data/README.md +261 -31
- data/app/controllers/solid_objects/components_controller.rb +78 -0
- data/app/helpers/solid_objects/actor_helper.rb +13 -4
- data/config/routes.rb +1 -0
- data/db/migrate/20260806000000_add_state_revision_to_solid_objects_instances.rb +12 -0
- data/docs/architecture.md +116 -23
- data/docs/authorization.md +53 -3
- data/docs/benchmarks.md +6 -2
- data/docs/correctness.md +45 -1
- data/docs/database-schema.md +18 -5
- data/docs/development.md +40 -0
- data/docs/fit.md +10 -2
- data/docs/migrating-existing-state.md +8 -1
- data/docs/operations.md +74 -36
- data/docs/realtime.md +106 -12
- data/docs/roadmap.md +14 -7
- data/docs/security.md +25 -3
- data/docs/state-migrations.md +2 -0
- data/examples/application/README.md +5 -4
- data/examples/application/app/views/actors/chat_room_actor/_messages.html.erb +1 -1
- data/examples/application/app/views/chat_rooms/show.html.erb +2 -2
- data/examples/application/config/initializers/solid_objects.rb +9 -3
- data/lib/generators/solid_objects/templates/solid_objects.rb +33 -2
- data/lib/solid_objects/activation.rb +33 -4
- data/lib/solid_objects/actor.rb +58 -6
- data/lib/solid_objects/actor_channel.rb +73 -5
- data/lib/solid_objects/actor_definition.rb +2 -0
- data/lib/solid_objects/actor_snapshot.rb +35 -10
- data/lib/solid_objects/actor_view.rb +103 -10
- data/lib/solid_objects/application_write_guard.rb +24 -0
- data/lib/solid_objects/caller_process.rb +28 -0
- data/lib/solid_objects/cli.rb +44 -5
- data/lib/solid_objects/client.rb +98 -5
- data/lib/solid_objects/commit_action_registry.rb +42 -0
- data/lib/solid_objects/component_path_resolver.rb +27 -0
- data/lib/solid_objects/component_registration.rb +117 -0
- data/lib/solid_objects/component_renderer.rb +82 -0
- data/lib/solid_objects/component_subscriptions.rb +109 -0
- data/lib/solid_objects/component_token.rb +139 -0
- data/lib/solid_objects/component_view.rb +67 -0
- data/lib/solid_objects/configuration.rb +39 -1
- data/lib/solid_objects/database_adapter.rb +28 -1
- data/lib/solid_objects/database_adapters/mysql.rb +46 -0
- data/lib/solid_objects/database_adapters/postgresql.rb +29 -0
- data/lib/solid_objects/database_adapters/sqlite.rb +40 -0
- data/lib/solid_objects/errors.rb +156 -0
- data/lib/solid_objects/executor.rb +65 -4
- data/lib/solid_objects/instance_pruner.rb +97 -0
- data/lib/solid_objects/message_pruner.rb +97 -0
- data/lib/solid_objects/message_reference.rb +9 -0
- data/lib/solid_objects/process_pruner.rb +49 -0
- data/lib/solid_objects/reference.rb +5 -0
- data/lib/solid_objects/state_snapshot.rb +41 -0
- data/lib/solid_objects/stream_token.rb +32 -13
- data/lib/solid_objects/sync_deadline.rb +57 -0
- data/lib/solid_objects/sync_diagnostics.rb +133 -0
- data/lib/solid_objects/synchronous_invocation.rb +26 -7
- data/lib/solid_objects/test_helper.rb +78 -0
- data/lib/solid_objects/turbo_stream_renderer.rb +45 -1
- data/lib/solid_objects/version.rb +1 -1
- data/lib/solid_objects/worker.rb +1 -1
- data/lib/solid_objects.rb +40 -0
- data/sig/generated/controllers/solid_objects/components_controller.rbs +22 -0
- data/sig/generated/lib/solid_objects/activation.rbs +3 -0
- data/sig/generated/lib/solid_objects/actor.rbs +29 -0
- data/sig/generated/lib/solid_objects/actor_channel.rbs +20 -0
- data/sig/generated/lib/solid_objects/actor_snapshot.rbs +17 -0
- data/sig/generated/lib/solid_objects/actor_view.rbs +31 -2
- data/sig/generated/lib/solid_objects/application_write_guard.rbs +8 -0
- data/sig/generated/lib/solid_objects/caller_process.rbs +11 -0
- data/sig/generated/lib/solid_objects/cli.rbs +11 -2
- data/sig/generated/lib/solid_objects/client.rbs +15 -0
- data/sig/generated/lib/solid_objects/commit_action_registry.rbs +43 -0
- data/sig/generated/lib/solid_objects/component_path_resolver.rbs +13 -0
- data/sig/generated/lib/solid_objects/component_registration.rbs +51 -0
- data/sig/generated/lib/solid_objects/component_renderer.rbs +39 -0
- data/sig/generated/lib/solid_objects/component_subscriptions.rbs +40 -0
- data/sig/generated/lib/solid_objects/component_token.rbs +38 -0
- data/sig/generated/lib/solid_objects/component_view.rbs +43 -0
- data/sig/generated/lib/solid_objects/configuration.rbs +35 -7
- data/sig/generated/lib/solid_objects/database_adapter.rbs +9 -0
- data/sig/generated/lib/solid_objects/database_adapters/mysql.rbs +8 -0
- data/sig/generated/lib/solid_objects/database_adapters/postgresql.rbs +8 -0
- data/sig/generated/lib/solid_objects/database_adapters/sqlite.rbs +13 -0
- data/sig/generated/lib/solid_objects/errors.rbs +130 -0
- data/sig/generated/lib/solid_objects/executor.rbs +12 -0
- data/sig/generated/lib/solid_objects/instance_pruner.rbs +36 -0
- data/sig/generated/lib/solid_objects/message_pruner.rbs +42 -0
- data/sig/generated/lib/solid_objects/message_reference.rbs +3 -0
- data/sig/generated/lib/solid_objects/process_pruner.rbs +27 -0
- data/sig/generated/lib/solid_objects/reference.rbs +3 -0
- data/sig/generated/lib/solid_objects/state_snapshot.rbs +30 -0
- data/sig/generated/lib/solid_objects/stream_token.rbs +9 -4
- data/sig/generated/lib/solid_objects/sync_deadline.rbs +31 -0
- data/sig/generated/lib/solid_objects/sync_diagnostics.rbs +34 -0
- data/sig/generated/lib/solid_objects/synchronous_invocation.rbs +3 -0
- data/sig/generated/lib/solid_objects/test_helper.rbs +25 -0
- data/sig/generated/lib/solid_objects/turbo_stream_renderer.rbs +10 -0
- data/sig/generated/lib/solid_objects.rbs +12 -0
- metadata +34 -1
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# Generated from lib/solid_objects/component_registration.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module SolidObjects
|
|
4
|
+
class ComponentRegistration
|
|
5
|
+
@reference: Reference
|
|
6
|
+
|
|
7
|
+
@component_name: String
|
|
8
|
+
|
|
9
|
+
@dependencies: Array[String]
|
|
10
|
+
|
|
11
|
+
@instance_id: Integer
|
|
12
|
+
|
|
13
|
+
@revision: Integer
|
|
14
|
+
|
|
15
|
+
@refresh_path: String
|
|
16
|
+
|
|
17
|
+
@token: String
|
|
18
|
+
|
|
19
|
+
attr_reader reference: untyped
|
|
20
|
+
|
|
21
|
+
attr_reader component_name: untyped
|
|
22
|
+
|
|
23
|
+
attr_reader dependencies: untyped
|
|
24
|
+
|
|
25
|
+
attr_reader instance_id: untyped
|
|
26
|
+
|
|
27
|
+
attr_reader revision: untyped
|
|
28
|
+
|
|
29
|
+
attr_reader refresh_path: untyped
|
|
30
|
+
|
|
31
|
+
attr_reader token: untyped
|
|
32
|
+
|
|
33
|
+
# @rbs (reference: Reference, component_name: String, dependencies: Array[String], instance_id: Integer, revision: Integer, refresh_path: String, token: String) -> void
|
|
34
|
+
def initialize: (reference: Reference, component_name: String, dependencies: Array[String], instance_id: Integer, revision: Integer, refresh_path: String, token: String) -> void
|
|
35
|
+
|
|
36
|
+
# @rbs (reference: Reference, component_name: String, dependencies: Array[String], snapshot: ActorSnapshot, refresh_path: String) -> ComponentRegistration
|
|
37
|
+
def self.issue: (reference: Reference, component_name: String, dependencies: Array[String], snapshot: ActorSnapshot, refresh_path: String) -> ComponentRegistration
|
|
38
|
+
|
|
39
|
+
# @rbs (String) -> ComponentRegistration
|
|
40
|
+
def self.from_token: (String) -> ComponentRegistration
|
|
41
|
+
|
|
42
|
+
# @rbs (Reference, Array[String]) -> void
|
|
43
|
+
private def self.validate_dependencies!: (Reference, Array[String]) -> void
|
|
44
|
+
|
|
45
|
+
# @rbs () -> Array[Integer]
|
|
46
|
+
def revision_key: () -> Array[Integer]
|
|
47
|
+
|
|
48
|
+
# @rbs (Integer, Integer) -> String
|
|
49
|
+
def refresh_url: (Integer, Integer) -> String
|
|
50
|
+
end
|
|
51
|
+
end
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Generated from lib/solid_objects/component_renderer.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module SolidObjects
|
|
4
|
+
class ComponentRenderer
|
|
5
|
+
@snapshot: ActorSnapshot
|
|
6
|
+
|
|
7
|
+
@component_name: String
|
|
8
|
+
|
|
9
|
+
@dependencies: Array[String]
|
|
10
|
+
|
|
11
|
+
@view_context: untyped
|
|
12
|
+
|
|
13
|
+
@authorization_context: untyped
|
|
14
|
+
|
|
15
|
+
# @rbs (snapshot: ActorSnapshot, component_name: String, dependencies: Array[String], view_context: untyped, authorization_context: untyped) -> void
|
|
16
|
+
def initialize: (snapshot: ActorSnapshot, component_name: String, dependencies: Array[String], view_context: untyped, authorization_context: untyped) -> void
|
|
17
|
+
|
|
18
|
+
# @rbs () -> untyped
|
|
19
|
+
def call: () -> untyped
|
|
20
|
+
|
|
21
|
+
private
|
|
22
|
+
|
|
23
|
+
attr_reader snapshot: untyped
|
|
24
|
+
|
|
25
|
+
attr_reader component_name: untyped
|
|
26
|
+
|
|
27
|
+
attr_reader dependencies: untyped
|
|
28
|
+
|
|
29
|
+
attr_reader view_context: untyped
|
|
30
|
+
|
|
31
|
+
attr_reader authorization_context: untyped
|
|
32
|
+
|
|
33
|
+
# @rbs (String) -> void
|
|
34
|
+
def authorize_read!: (String) -> void
|
|
35
|
+
|
|
36
|
+
# @rbs () -> String
|
|
37
|
+
def default_partial: () -> String
|
|
38
|
+
end
|
|
39
|
+
end
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# Generated from lib/solid_objects/component_subscriptions.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module SolidObjects
|
|
4
|
+
class ComponentSubscriptions
|
|
5
|
+
MAXIMUM_COMPONENTS: ::Integer
|
|
6
|
+
|
|
7
|
+
MAXIMUM_SERIALIZED_BYTES: ::Integer
|
|
8
|
+
|
|
9
|
+
@registrations: Array[ComponentRegistration]
|
|
10
|
+
|
|
11
|
+
@revisions: Hash[String, Array[Integer]]
|
|
12
|
+
|
|
13
|
+
# @rbs (String?, reference: Reference) -> ComponentSubscriptions
|
|
14
|
+
def self.parse: (String?, reference: Reference) -> ComponentSubscriptions
|
|
15
|
+
|
|
16
|
+
# @rbs (Array[ComponentRegistration]) -> void
|
|
17
|
+
def initialize: (Array[ComponentRegistration]) -> void
|
|
18
|
+
|
|
19
|
+
# @rbs (Hash[String, untyped]) -> Array[String]
|
|
20
|
+
def refreshes_for: (Hash[String, untyped]) -> Array[String]
|
|
21
|
+
|
|
22
|
+
# @rbs (ActorSnapshot) -> Array[String]
|
|
23
|
+
def reconnect_refreshes: (ActorSnapshot) -> Array[String]
|
|
24
|
+
|
|
25
|
+
# @rbs (ComponentRegistration, Reference) -> void
|
|
26
|
+
private def self.validate_identity!: (ComponentRegistration, Reference) -> void
|
|
27
|
+
|
|
28
|
+
private
|
|
29
|
+
|
|
30
|
+
attr_reader registrations: untyped
|
|
31
|
+
|
|
32
|
+
attr_reader revisions: untyped
|
|
33
|
+
|
|
34
|
+
# @rbs (ComponentRegistration, Integer, Integer) -> String
|
|
35
|
+
def refresh: (ComponentRegistration, Integer, Integer) -> String
|
|
36
|
+
|
|
37
|
+
# @rbs (String, Integer, Integer) -> bool
|
|
38
|
+
def newer_revision?: (String, Integer, Integer) -> bool
|
|
39
|
+
end
|
|
40
|
+
end
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Generated from lib/solid_objects/component_token.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module SolidObjects
|
|
4
|
+
module ComponentToken
|
|
5
|
+
PURPOSE: ::String
|
|
6
|
+
|
|
7
|
+
MAXIMUM_TOKEN_BYTES: ::Integer
|
|
8
|
+
|
|
9
|
+
MAXIMUM_DEPENDENCIES: ::Integer
|
|
10
|
+
|
|
11
|
+
# @rbs (reference: Reference, component_name: String, dependencies: Array[String], instance_id: Integer, revision: Integer, refresh_path: String) -> String
|
|
12
|
+
def self?.generate: (reference: Reference, component_name: String, dependencies: Array[String], instance_id: Integer, revision: Integer, refresh_path: String) -> String
|
|
13
|
+
|
|
14
|
+
# @rbs (String) -> Hash[String, untyped]
|
|
15
|
+
def self?.verify: (String) -> Hash[String, untyped]
|
|
16
|
+
|
|
17
|
+
# @rbs (Hash[String, untyped]) -> Hash[String, untyped]
|
|
18
|
+
def self?.validate_payload!: (Hash[String, untyped]) -> Hash[String, untyped]
|
|
19
|
+
|
|
20
|
+
# @rbs (String) -> void
|
|
21
|
+
def self?.validate_component_name!: (String) -> void
|
|
22
|
+
|
|
23
|
+
# @rbs (Array[untyped]) -> void
|
|
24
|
+
def self?.validate_dependencies!: (Array[untyped]) -> void
|
|
25
|
+
|
|
26
|
+
# @rbs (Integer, Integer) -> void
|
|
27
|
+
def self?.validate_revision!: (Integer, Integer) -> void
|
|
28
|
+
|
|
29
|
+
# @rbs (String) -> void
|
|
30
|
+
def self?.validate_refresh_path!: (String) -> void
|
|
31
|
+
|
|
32
|
+
# @rbs () -> ActiveSupport::MessageVerifier
|
|
33
|
+
def self?.verifier: () -> ActiveSupport::MessageVerifier
|
|
34
|
+
|
|
35
|
+
# @rbs () -> String
|
|
36
|
+
def self?.signing_secret: () -> String
|
|
37
|
+
end
|
|
38
|
+
end
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Generated from lib/solid_objects/component_view.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module SolidObjects
|
|
4
|
+
class ComponentView
|
|
5
|
+
@snapshot: ActorSnapshot
|
|
6
|
+
|
|
7
|
+
@dependencies: Array[String]
|
|
8
|
+
|
|
9
|
+
@authorization_context: untyped
|
|
10
|
+
|
|
11
|
+
attr_reader authorization_context: untyped
|
|
12
|
+
|
|
13
|
+
# @rbs (snapshot: ActorSnapshot, dependencies: Array[String], authorization_context: untyped) -> void
|
|
14
|
+
def initialize: (snapshot: ActorSnapshot, dependencies: Array[String], authorization_context: untyped) -> void
|
|
15
|
+
|
|
16
|
+
# @rbs () -> Reference
|
|
17
|
+
def reference: () -> Reference
|
|
18
|
+
|
|
19
|
+
# @rbs () -> String
|
|
20
|
+
def actor_id: () -> String
|
|
21
|
+
|
|
22
|
+
# @rbs () -> void
|
|
23
|
+
def state: () -> void
|
|
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
|
+
private
|
|
32
|
+
|
|
33
|
+
attr_reader snapshot: untyped
|
|
34
|
+
|
|
35
|
+
attr_reader dependencies: untyped
|
|
36
|
+
|
|
37
|
+
# @rbs (Symbol | String) -> bool
|
|
38
|
+
def observable?: (Symbol | String) -> bool
|
|
39
|
+
|
|
40
|
+
# @rbs (Symbol | String) -> untyped
|
|
41
|
+
def observable_value: (Symbol | String) -> untyped
|
|
42
|
+
end
|
|
43
|
+
end
|
|
@@ -2,15 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
module SolidObjects
|
|
4
4
|
class Configuration
|
|
5
|
-
@
|
|
5
|
+
@table_name_prefix: String
|
|
6
6
|
|
|
7
|
-
@
|
|
7
|
+
@shutdown_timeout: Float
|
|
8
8
|
|
|
9
|
-
@
|
|
9
|
+
@message_retention: Numeric
|
|
10
10
|
|
|
11
|
-
@
|
|
11
|
+
@message_retention_by_actor_type: Hash[String, Numeric]
|
|
12
12
|
|
|
13
|
-
@
|
|
13
|
+
@instance_retention_by_actor_type: Hash[String, Numeric]
|
|
14
|
+
|
|
15
|
+
@process_retention: Numeric
|
|
16
|
+
|
|
17
|
+
@prune_batch_size: Integer
|
|
14
18
|
|
|
15
19
|
@worker_count: Integer
|
|
16
20
|
|
|
@@ -30,6 +34,10 @@ module SolidObjects
|
|
|
30
34
|
|
|
31
35
|
@wake_up_adapter: untyped
|
|
32
36
|
|
|
37
|
+
@component_path_resolver: Proc?
|
|
38
|
+
|
|
39
|
+
@component_authorization_context: Proc
|
|
40
|
+
|
|
33
41
|
@authorize_message: Proc
|
|
34
42
|
|
|
35
43
|
@authorize_query: Proc
|
|
@@ -40,8 +48,6 @@ module SolidObjects
|
|
|
40
48
|
|
|
41
49
|
@authorize_administration: Proc
|
|
42
50
|
|
|
43
|
-
@table_name_prefix: String
|
|
44
|
-
|
|
45
51
|
@polling_interval: Float
|
|
46
52
|
|
|
47
53
|
@sync_polling_interval: Float
|
|
@@ -66,6 +72,14 @@ module SolidObjects
|
|
|
66
72
|
|
|
67
73
|
@max_result_bytes: Integer
|
|
68
74
|
|
|
75
|
+
@max_attempts: Integer
|
|
76
|
+
|
|
77
|
+
@retry_delay: Proc
|
|
78
|
+
|
|
79
|
+
@process_heartbeat_interval: Float
|
|
80
|
+
|
|
81
|
+
@process_alive_threshold: Float
|
|
82
|
+
|
|
69
83
|
attr_accessor table_name_prefix: untyped
|
|
70
84
|
|
|
71
85
|
attr_accessor polling_interval: untyped
|
|
@@ -102,6 +116,16 @@ module SolidObjects
|
|
|
102
116
|
|
|
103
117
|
attr_accessor shutdown_timeout: untyped
|
|
104
118
|
|
|
119
|
+
attr_accessor message_retention: untyped
|
|
120
|
+
|
|
121
|
+
attr_accessor message_retention_by_actor_type: untyped
|
|
122
|
+
|
|
123
|
+
attr_accessor instance_retention_by_actor_type: untyped
|
|
124
|
+
|
|
125
|
+
attr_accessor process_retention: untyped
|
|
126
|
+
|
|
127
|
+
attr_accessor prune_batch_size: untyped
|
|
128
|
+
|
|
105
129
|
attr_accessor worker_count: untyped
|
|
106
130
|
|
|
107
131
|
attr_accessor effect_worker_count: untyped
|
|
@@ -120,6 +144,10 @@ module SolidObjects
|
|
|
120
144
|
|
|
121
145
|
attr_accessor wake_up_adapter: untyped
|
|
122
146
|
|
|
147
|
+
attr_accessor component_path_resolver: untyped
|
|
148
|
+
|
|
149
|
+
attr_accessor component_authorization_context: untyped
|
|
150
|
+
|
|
123
151
|
attr_accessor authorize_message: untyped
|
|
124
152
|
|
|
125
153
|
attr_accessor authorize_query: untyped
|
|
@@ -36,6 +36,15 @@ module SolidObjects
|
|
|
36
36
|
|
|
37
37
|
attr_reader fixed_connection: untyped
|
|
38
38
|
|
|
39
|
+
# @rbs (untyped) { () -> untyped } -> untyped
|
|
40
|
+
def with_transaction_deadline: (untyped) { () -> untyped } -> untyped
|
|
41
|
+
|
|
42
|
+
# @rbs (untyped) -> void
|
|
43
|
+
def configure_transaction_deadline: (untyped) -> void
|
|
44
|
+
|
|
45
|
+
# @rbs (Exception) -> bool
|
|
46
|
+
def deadline_error?: (Exception) -> bool
|
|
47
|
+
|
|
39
48
|
# @rbs () { (untyped) -> untyped } -> untyped
|
|
40
49
|
def with_connection: () { (untyped) -> untyped } -> untyped
|
|
41
50
|
end
|
|
@@ -11,6 +11,14 @@ module SolidObjects
|
|
|
11
11
|
|
|
12
12
|
# @rbs () -> String
|
|
13
13
|
def current_time_expression: () -> String
|
|
14
|
+
|
|
15
|
+
private
|
|
16
|
+
|
|
17
|
+
# @rbs (untyped) { () -> untyped } -> untyped
|
|
18
|
+
def with_transaction_deadline: (untyped) { () -> untyped } -> untyped
|
|
19
|
+
|
|
20
|
+
# @rbs (Exception) -> bool
|
|
21
|
+
def deadline_error?: (Exception) -> bool
|
|
14
22
|
end
|
|
15
23
|
end
|
|
16
24
|
end
|
|
@@ -8,6 +8,14 @@ module SolidObjects
|
|
|
8
8
|
|
|
9
9
|
# @rbs () -> String
|
|
10
10
|
def claim_lock: () -> String
|
|
11
|
+
|
|
12
|
+
private
|
|
13
|
+
|
|
14
|
+
# @rbs (untyped) -> void
|
|
15
|
+
def configure_transaction_deadline: (untyped) -> void
|
|
16
|
+
|
|
17
|
+
# @rbs (Exception) -> bool
|
|
18
|
+
def deadline_error?: (Exception) -> bool
|
|
11
19
|
end
|
|
12
20
|
end
|
|
13
21
|
end
|
|
@@ -3,8 +3,21 @@
|
|
|
3
3
|
module SolidObjects
|
|
4
4
|
module DatabaseAdapters
|
|
5
5
|
class Sqlite < DatabaseAdapter
|
|
6
|
+
LOCK_RETRY_INTERVAL: ::Float
|
|
7
|
+
|
|
6
8
|
# @rbs () -> String
|
|
7
9
|
def current_time_expression: () -> String
|
|
10
|
+
|
|
11
|
+
# @rbs () { () -> untyped } -> untyped
|
|
12
|
+
def transaction: () { () -> untyped } -> untyped
|
|
13
|
+
|
|
14
|
+
private
|
|
15
|
+
|
|
16
|
+
# @rbs (untyped) { () -> untyped } -> untyped
|
|
17
|
+
def with_transaction_deadline: (untyped) { () -> untyped } -> untyped
|
|
18
|
+
|
|
19
|
+
# @rbs (Exception) -> bool
|
|
20
|
+
def deadline_error?: (Exception) -> bool
|
|
8
21
|
end
|
|
9
22
|
end
|
|
10
23
|
end
|
|
@@ -4,6 +4,9 @@ module SolidObjects
|
|
|
4
4
|
class Error < StandardError
|
|
5
5
|
end
|
|
6
6
|
|
|
7
|
+
class NonRetryableError < Error
|
|
8
|
+
end
|
|
9
|
+
|
|
7
10
|
class UnsupportedDatabase < Error
|
|
8
11
|
end
|
|
9
12
|
|
|
@@ -34,13 +37,140 @@ module SolidObjects
|
|
|
34
37
|
class InvalidStreamToken < Error
|
|
35
38
|
end
|
|
36
39
|
|
|
40
|
+
class InvalidComponentToken < Error
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
class UnknownComponent < Error
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
class UnknownComponentDependency < Error
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
class UnsupportedComponentRendering < Error
|
|
50
|
+
end
|
|
51
|
+
|
|
37
52
|
class LostActivation < Error
|
|
38
53
|
end
|
|
39
54
|
|
|
40
55
|
class ActorDestroyed < LostActivation
|
|
41
56
|
end
|
|
42
57
|
|
|
58
|
+
class DatabaseDeadlineExceeded < Error
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
class SyncEnqueueTimeout < Error
|
|
62
|
+
@timeout: Numeric
|
|
63
|
+
|
|
64
|
+
@actor_type: String
|
|
65
|
+
|
|
66
|
+
@actor_id: String
|
|
67
|
+
|
|
68
|
+
@message_name: String
|
|
69
|
+
|
|
70
|
+
attr_reader timeout: untyped
|
|
71
|
+
|
|
72
|
+
attr_reader actor_type: untyped
|
|
73
|
+
|
|
74
|
+
attr_reader actor_id: untyped
|
|
75
|
+
|
|
76
|
+
attr_reader message_name: untyped
|
|
77
|
+
|
|
78
|
+
# @rbs (timeout: Numeric, actor_type: String, actor_id: String, message_name: String) -> void
|
|
79
|
+
def initialize: (timeout: Numeric, actor_type: String, actor_id: String, message_name: String) -> void
|
|
80
|
+
end
|
|
81
|
+
|
|
43
82
|
class SyncTimeout < Error
|
|
83
|
+
@timeout: Numeric
|
|
84
|
+
|
|
85
|
+
@actor_type: String
|
|
86
|
+
|
|
87
|
+
@actor_id: String
|
|
88
|
+
|
|
89
|
+
@message_name: String
|
|
90
|
+
|
|
91
|
+
@message_id: Integer
|
|
92
|
+
|
|
93
|
+
@request_id: String
|
|
94
|
+
|
|
95
|
+
@sequence: Integer
|
|
96
|
+
|
|
97
|
+
@status: String
|
|
98
|
+
|
|
99
|
+
@waiting_on: String
|
|
100
|
+
|
|
101
|
+
@activation: Hash[String, untyped]
|
|
102
|
+
|
|
103
|
+
@blocker: Hash[String, untyped]?
|
|
104
|
+
|
|
105
|
+
attr_reader timeout: untyped
|
|
106
|
+
|
|
107
|
+
attr_reader actor_type: untyped
|
|
108
|
+
|
|
109
|
+
attr_reader actor_id: untyped
|
|
110
|
+
|
|
111
|
+
attr_reader message_name: untyped
|
|
112
|
+
|
|
113
|
+
attr_reader message_id: untyped
|
|
114
|
+
|
|
115
|
+
attr_reader request_id: untyped
|
|
116
|
+
|
|
117
|
+
attr_reader sequence: untyped
|
|
118
|
+
|
|
119
|
+
attr_reader status: untyped
|
|
120
|
+
|
|
121
|
+
attr_reader waiting_on: untyped
|
|
122
|
+
|
|
123
|
+
attr_reader activation: untyped
|
|
124
|
+
|
|
125
|
+
attr_reader blocker: untyped
|
|
126
|
+
|
|
127
|
+
# @rbs (timeout: Numeric, actor_type: String, actor_id: String, message_name: String, message_id: Integer, request_id: String, sequence: Integer, status: String, waiting_on: String, activation: Hash[String, untyped], blocker: Hash[String, untyped]?) -> void
|
|
128
|
+
def initialize: (timeout: Numeric, actor_type: String, actor_id: String, message_name: String, message_id: Integer, request_id: String, sequence: Integer, status: String, waiting_on: String, activation: Hash[String, untyped], blocker: Hash[String, untyped]?) -> void
|
|
129
|
+
|
|
130
|
+
# @rbs () -> MessageReference
|
|
131
|
+
def message_reference: () -> MessageReference
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
class SyncInsideTransaction < Error
|
|
135
|
+
@actor_type: String
|
|
136
|
+
|
|
137
|
+
@actor_id: String
|
|
138
|
+
|
|
139
|
+
@message_name: String
|
|
140
|
+
|
|
141
|
+
attr_reader actor_type: untyped
|
|
142
|
+
|
|
143
|
+
attr_reader actor_id: untyped
|
|
144
|
+
|
|
145
|
+
attr_reader message_name: untyped
|
|
146
|
+
|
|
147
|
+
# @rbs (actor_type: String, actor_id: String, message_name: String) -> void
|
|
148
|
+
def initialize: (actor_type: String, actor_id: String, message_name: String) -> void
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
class ApplicationWriteForbidden < NonRetryableError
|
|
152
|
+
@actor_type: String
|
|
153
|
+
|
|
154
|
+
@actor_id: String
|
|
155
|
+
|
|
156
|
+
@message_name: String
|
|
157
|
+
|
|
158
|
+
attr_reader actor_type: untyped
|
|
159
|
+
|
|
160
|
+
attr_reader actor_id: untyped
|
|
161
|
+
|
|
162
|
+
attr_reader message_name: untyped
|
|
163
|
+
|
|
164
|
+
# @rbs (actor_type: String, actor_id: String, message_name: String) -> void
|
|
165
|
+
def initialize: (actor_type: String, actor_id: String, message_name: String) -> void
|
|
166
|
+
end
|
|
167
|
+
|
|
168
|
+
class CommitActionUnavailable < NonRetryableError
|
|
169
|
+
# @rbs (actor_type: String, actor_id: String, message_name: String) -> void
|
|
170
|
+
def initialize: (actor_type: String, actor_id: String, message_name: String) -> void
|
|
171
|
+
end
|
|
172
|
+
|
|
173
|
+
class UnknownCommitAction < NonRetryableError
|
|
44
174
|
end
|
|
45
175
|
|
|
46
176
|
class Rejected < Error
|
|
@@ -21,6 +21,9 @@ module SolidObjects
|
|
|
21
21
|
# @rbs () -> Actor
|
|
22
22
|
def actor: () -> Actor
|
|
23
23
|
|
|
24
|
+
# @rbs (MessageContext) -> untyped
|
|
25
|
+
def invoke_actor: (MessageContext) -> untyped
|
|
26
|
+
|
|
24
27
|
# @rbs (Hash[String, untyped]) -> void
|
|
25
28
|
def ensure_query_did_not_mutate_state!: (Hash[String, untyped]) -> void
|
|
26
29
|
|
|
@@ -30,6 +33,15 @@ module SolidObjects
|
|
|
30
33
|
# @rbs (untyped, Hash[String, untyped]) -> void
|
|
31
34
|
def complete: (untyped, Hash[String, untyped]) -> void
|
|
32
35
|
|
|
36
|
+
# @rbs (Array[Actor::CommitActionIntent]) -> void
|
|
37
|
+
def execute_commit_actions: (Array[Actor::CommitActionIntent]) -> void
|
|
38
|
+
|
|
39
|
+
# @rbs (Actor::CommitActionIntent, Proc, CommitActionContext) -> untyped
|
|
40
|
+
def execute_commit_action: (Actor::CommitActionIntent, Proc, CommitActionContext) -> untyped
|
|
41
|
+
|
|
42
|
+
# @rbs () -> void
|
|
43
|
+
def ensure_application_database_is_shared!: () -> void
|
|
44
|
+
|
|
33
45
|
# @rbs (Message, Instance, Array[Actor::EffectIntent]) -> Array[Effect]
|
|
34
46
|
def enqueue_effects: (Message, Instance, Array[Actor::EffectIntent]) -> Array[Effect]
|
|
35
47
|
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Generated from lib/solid_objects/instance_pruner.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module SolidObjects
|
|
4
|
+
class InstancePruner
|
|
5
|
+
@now: Time
|
|
6
|
+
|
|
7
|
+
@batch_size: Integer
|
|
8
|
+
|
|
9
|
+
# @rbs (?now: Time, ?batch_size: Integer) -> void
|
|
10
|
+
def initialize: (?now: Time, ?batch_size: Integer) -> void
|
|
11
|
+
|
|
12
|
+
# @rbs () -> Integer
|
|
13
|
+
def preview: () -> Integer
|
|
14
|
+
|
|
15
|
+
# @rbs () -> Integer
|
|
16
|
+
def prune: () -> Integer
|
|
17
|
+
|
|
18
|
+
private
|
|
19
|
+
|
|
20
|
+
attr_reader now: untyped
|
|
21
|
+
|
|
22
|
+
attr_reader batch_size: untyped
|
|
23
|
+
|
|
24
|
+
# @rbs () -> Array[ActiveRecord::Relation[Instance]]
|
|
25
|
+
def policy_relations: () -> Array[ActiveRecord::Relation[Instance]]
|
|
26
|
+
|
|
27
|
+
# @rbs () -> ActiveRecord::Relation[Instance]
|
|
28
|
+
def prunable: () -> ActiveRecord::Relation[Instance]
|
|
29
|
+
|
|
30
|
+
# @rbs (ActiveRecord::Relation[Instance]) -> Integer
|
|
31
|
+
def prune_relation: (ActiveRecord::Relation[Instance]) -> Integer
|
|
32
|
+
|
|
33
|
+
# @rbs (Integer, ActiveRecord::Relation[Instance]) -> Integer
|
|
34
|
+
def prune_instance: (Integer, ActiveRecord::Relation[Instance]) -> Integer
|
|
35
|
+
end
|
|
36
|
+
end
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# Generated from lib/solid_objects/message_pruner.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module SolidObjects
|
|
4
|
+
class MessagePruner
|
|
5
|
+
@now: Time
|
|
6
|
+
|
|
7
|
+
@batch_size: Integer
|
|
8
|
+
|
|
9
|
+
# @rbs (?now: Time, ?batch_size: Integer) -> void
|
|
10
|
+
def initialize: (?now: Time, ?batch_size: Integer) -> void
|
|
11
|
+
|
|
12
|
+
# @rbs () -> Integer
|
|
13
|
+
def preview: () -> Integer
|
|
14
|
+
|
|
15
|
+
# @rbs () -> Integer
|
|
16
|
+
def prune: () -> Integer
|
|
17
|
+
|
|
18
|
+
private
|
|
19
|
+
|
|
20
|
+
attr_reader now: untyped
|
|
21
|
+
|
|
22
|
+
attr_reader batch_size: untyped
|
|
23
|
+
|
|
24
|
+
# @rbs () -> Array[ActiveRecord::Relation[Message]]
|
|
25
|
+
def policy_relations: () -> Array[ActiveRecord::Relation[Message]]
|
|
26
|
+
|
|
27
|
+
# @rbs () -> ActiveRecord::Relation[Message]
|
|
28
|
+
def prunable: () -> ActiveRecord::Relation[Message]
|
|
29
|
+
|
|
30
|
+
# @rbs (ActiveRecord::Relation[Message]) -> Integer
|
|
31
|
+
def prune_relation: (ActiveRecord::Relation[Message]) -> Integer
|
|
32
|
+
|
|
33
|
+
# @rbs () -> Numeric
|
|
34
|
+
def default_retention: () -> Numeric
|
|
35
|
+
|
|
36
|
+
# @rbs () -> Hash[String, Numeric]
|
|
37
|
+
def retention_overrides: () -> Hash[String, Numeric]
|
|
38
|
+
|
|
39
|
+
# @rbs (Numeric) -> Time
|
|
40
|
+
def retention_cutoff: (Numeric) -> Time
|
|
41
|
+
end
|
|
42
|
+
end
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Generated from lib/solid_objects/process_pruner.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module SolidObjects
|
|
4
|
+
class ProcessPruner
|
|
5
|
+
@now: Time
|
|
6
|
+
|
|
7
|
+
@batch_size: Integer
|
|
8
|
+
|
|
9
|
+
# @rbs (?now: Time, ?batch_size: Integer) -> void
|
|
10
|
+
def initialize: (?now: Time, ?batch_size: Integer) -> void
|
|
11
|
+
|
|
12
|
+
# @rbs () -> Integer
|
|
13
|
+
def preview: () -> Integer
|
|
14
|
+
|
|
15
|
+
# @rbs () -> Integer
|
|
16
|
+
def prune: () -> Integer
|
|
17
|
+
|
|
18
|
+
private
|
|
19
|
+
|
|
20
|
+
attr_reader now: untyped
|
|
21
|
+
|
|
22
|
+
attr_reader batch_size: untyped
|
|
23
|
+
|
|
24
|
+
# @rbs () -> ActiveRecord::Relation[Process]
|
|
25
|
+
def prunable: () -> ActiveRecord::Relation[Process]
|
|
26
|
+
end
|
|
27
|
+
end
|
|
@@ -22,6 +22,9 @@ module SolidObjects
|
|
|
22
22
|
# @rbs (?authorization_context: untyped) -> bool
|
|
23
23
|
def destroy: (?authorization_context: untyped) -> bool
|
|
24
24
|
|
|
25
|
+
# @rbs (?authorization_context: untyped) -> StateSnapshot
|
|
26
|
+
def snapshot: (?authorization_context: untyped) -> StateSnapshot
|
|
27
|
+
|
|
25
28
|
# @rbs (Symbol, *untyped, **untyped) -> untyped
|
|
26
29
|
def method_missing: (Symbol, *untyped, **untyped) -> untyped
|
|
27
30
|
|