58
58
//
59
59
// Actors are usually created at the beginning of the SDK's communication flow with the Proxy by the registration step described above.
60
60
// However, some use cases require that Actors can be created ***on the fly***.
61
- // In other words, Spawn is used to bring to life Actors previously registered as Abstracts , giving them a name and thus creating a concrete instance
61
+ // In other words, Spawn is used to bring to life Actors previously registered as Unameds , giving them a name and thus creating a concrete instance
62
62
// at runtime for that Actor. Actors created with the Spawn feature are generally used when you want to share a behavior while maintaining
63
63
// the isolation characteristics of the actors.
64
64
// For these situations we have the Spawning flow described below.
135
135
// ║ ║ ║ ║
136
136
// ║ ║ ╠───┐ ║
137
137
// ║ ║ ║ │Handle request, ║
138
- // ║ ║ ║ │execute command ║
138
+ // ║ ║ ║ │execute action ║
139
139
// ║ ║ ║◀──┘ ║
140
140
// ║ ║ ║ Reply with the ║
141
141
// ║ ║ ╠────────────result and the ────────▶║
@@ -167,7 +167,8 @@ option go_package = "github.com/eigr/go-support/eigr/protocol;protocol";
167
167
//
168
168
// Params:
169
169
// * state: Actor state passed back and forth between proxy and user function.
170
- // * metadata: Meta information or headers
170
+ // * metadata: Meta information that comes in invocations
171
+ // * tags: Meta information stored in the actor
171
172
// * caller: ActorId of who is calling target actor
172
173
// * self: ActorId of itself
173
174
message Context {
@@ -176,6 +177,8 @@ message Context {
176
177
177
178
map <string , string > metadata = 4 ;
178
179
180
+ map <string , string > tags = 5 ;
181
+
179
182
// Who is calling target actor
180
183
eigr.functions.protocol.actors.ActorId caller = 2 ;
181
184
@@ -189,6 +192,12 @@ message Context {
189
192
// he does not care about the input value only with the state.
190
193
message Noop {}
191
194
195
+ // JSON is an alternative that some SDKs can opt in
196
+ // it will bypass any type validation in spawn actors state / payloads
197
+ message JSONType {
198
+ string content = 1 ;
199
+ }
200
+
192
201
message RegistrationRequest {
193
202
194
203
ServiceInfo service_info = 1 ;
@@ -268,8 +277,8 @@ message Broadcast {
268
277
// Channel of target Actors
269
278
string channel_group = 1 ;
270
279
271
- // Command . Only Actors that have this command will run successfully
272
- string command_name = 2 ;
280
+ // Action . Only Actors that have this action will run successfully
281
+ string action_name = 2 ;
273
282
274
283
// Payload
275
284
oneof payload {
@@ -278,26 +287,26 @@ message Broadcast {
278
287
}
279
288
}
280
289
281
- // Sends the output of a command of an Actor to the input of another command of an Actor
290
+ // Sends the output of a action of an Actor to the input of another action of an Actor
282
291
// Useful for handle `pipes` pattern:
283
292
// https://www.enterpriseintegrationpatterns.com/patterns/messaging/PipesAndFilters.html
284
293
message Pipe {
285
294
// Target Actor
286
295
string actor = 1 ;
287
296
288
- // Command .
289
- string command_name = 2 ;
297
+ // Action .
298
+ string action_name = 2 ;
290
299
}
291
300
292
- // Sends the input of a command of an Actor to the input of another command of an Actor
301
+ // Sends the input of a action of an Actor to the input of another action of an Actor
293
302
// Useful for handle `content-basead router` pattern
294
303
// https://www.enterpriseintegrationpatterns.com/patterns/messaging/ContentBasedRouter.html
295
304
message Forward {
296
305
// Target Actor
297
306
string actor = 1 ;
298
307
299
- // Command .
300
- string command_name = 2 ;
308
+ // Action .
309
+ string action_name = 2 ;
301
310
}
302
311
303
312
// Container for archicetural message patterns
@@ -316,22 +325,22 @@ message Workflow {
316
325
// The user function when it wants to send a message to an Actor uses the InvocationRequest message type.
317
326
//
318
327
// Params:
319
- // * system: See ActorStstem message.
328
+ // * system: See ActorSystem message.
320
329
// * actor: The target Actor, i.e. the one that the user function is calling to perform some computation.
321
330
// * caller: The caller Actor
322
- // * command_name : The function or method on the target Actor that will receive this request
331
+ // * action_name : The function or method on the target Actor that will receive this request
323
332
// and perform some useful computation with the sent data.
324
- // * value: This is the value sent by the user function to be computed by the request's target Actor command .
325
- // * async: Indicates whether the command should be processed synchronously, where a response should be sent back to the user function,
326
- // or whether the command should be processed asynchronously, i.e. no response sent to the caller and no waiting.
333
+ // * value: This is the value sent by the user function to be computed by the request's target Actor action .
334
+ // * async: Indicates whether the action should be processed synchronously, where a response should be sent back to the user function,
335
+ // or whether the action should be processed asynchronously, i.e. no response sent to the caller and no waiting.
327
336
// * metadata: Meta information or headers
328
337
message InvocationRequest {
329
338
330
339
eigr.functions.protocol.actors.ActorSystem system = 1 ;
331
340
332
341
eigr.functions.protocol.actors.Actor actor = 2 ;
333
342
334
- string command_name = 3 ;
343
+ string action_name = 3 ;
335
344
336
345
oneof payload {
337
346
google.protobuf.Any value = 4 ;
@@ -354,17 +363,17 @@ message InvocationRequest {
354
363
//
355
364
// Params:
356
365
// * actor: The ActorId handling the InvocationRequest request, also called the target Actor.
357
- // * command_name : The function or method on the target Actor that will receive this request
366
+ // * action_name : The function or method on the target Actor that will receive this request
358
367
// and perform some useful computation with the sent data.
359
368
// * current_context: The current Context with current state value of the target Actor.
360
369
// That is, the same as found via matching in %Actor{name: target_actor, state: %ActorState{state: value} = actor_state}.
361
370
// In this case, the Context type will contain in the value attribute the same `value` as the matching above.
362
- // * payload: The value to be passed to the function or method corresponding to command_name .
371
+ // * payload: The value to be passed to the function or method corresponding to action_name .
363
372
message ActorInvocation {
364
373
365
374
eigr.functions.protocol.actors.ActorId actor = 1 ;
366
375
367
- string command_name = 2 ;
376
+ string action_name = 2 ;
368
377
369
378
Context current_context = 3 ;
370
379
@@ -439,5 +448,3 @@ message RequestStatus {
439
448
440
449
string message = 2 ;
441
450
}
442
-
443
-
0 commit comments