5858//
5959// Actors are usually created at the beginning of the SDK's communication flow with the Proxy by the registration step described above.
6060// 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
6262// at runtime for that Actor. Actors created with the Spawn feature are generally used when you want to share a behavior while maintaining
6363// the isolation characteristics of the actors.
6464// For these situations we have the Spawning flow described below.
135135// ║ ║ ║ ║
136136// ║ ║ ╠───┐ ║
137137// ║ ║ ║ │Handle request, ║
138- // ║ ║ ║ │execute command ║
138+ // ║ ║ ║ │execute action ║
139139// ║ ║ ║◀──┘ ║
140140// ║ ║ ║ Reply with the ║
141141// ║ ║ ╠────────────result and the ────────▶║
@@ -167,7 +167,8 @@ option go_package = "github.com/eigr/go-support/eigr/protocol;protocol";
167167//
168168// Params:
169169// * 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
171172// * caller: ActorId of who is calling target actor
172173// * self: ActorId of itself
173174message Context {
@@ -176,6 +177,8 @@ message Context {
176177
177178 map <string , string > metadata = 4 ;
178179
180+ map <string , string > tags = 5 ;
181+
179182 // Who is calling target actor
180183 eigr.functions.protocol.actors.ActorId caller = 2 ;
181184
@@ -189,6 +192,12 @@ message Context {
189192// he does not care about the input value only with the state.
190193message Noop {}
191194
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+
192201message RegistrationRequest {
193202
194203 ServiceInfo service_info = 1 ;
@@ -268,8 +277,8 @@ message Broadcast {
268277 // Channel of target Actors
269278 string channel_group = 1 ;
270279
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 ;
273282
274283 // Payload
275284 oneof payload {
@@ -278,26 +287,26 @@ message Broadcast {
278287 }
279288}
280289
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
282291// Useful for handle `pipes` pattern:
283292// https://www.enterpriseintegrationpatterns.com/patterns/messaging/PipesAndFilters.html
284293message Pipe {
285294 // Target Actor
286295 string actor = 1 ;
287296
288- // Command .
289- string command_name = 2 ;
297+ // Action .
298+ string action_name = 2 ;
290299}
291300
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
293302// Useful for handle `content-basead router` pattern
294303// https://www.enterpriseintegrationpatterns.com/patterns/messaging/ContentBasedRouter.html
295304message Forward {
296305 // Target Actor
297306 string actor = 1 ;
298307
299- // Command .
300- string command_name = 2 ;
308+ // Action .
309+ string action_name = 2 ;
301310}
302311
303312// Container for archicetural message patterns
@@ -316,22 +325,22 @@ message Workflow {
316325// The user function when it wants to send a message to an Actor uses the InvocationRequest message type.
317326//
318327// Params:
319- // * system: See ActorStstem message.
328+ // * system: See ActorSystem message.
320329// * actor: The target Actor, i.e. the one that the user function is calling to perform some computation.
321330// * 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
323332// 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.
327336// * metadata: Meta information or headers
328337message InvocationRequest {
329338
330339 eigr.functions.protocol.actors.ActorSystem system = 1 ;
331340
332341 eigr.functions.protocol.actors.Actor actor = 2 ;
333342
334- string command_name = 3 ;
343+ string action_name = 3 ;
335344
336345 oneof payload {
337346 google.protobuf.Any value = 4 ;
@@ -354,17 +363,17 @@ message InvocationRequest {
354363//
355364// Params:
356365// * 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
358367// and perform some useful computation with the sent data.
359368// * current_context: The current Context with current state value of the target Actor.
360369// That is, the same as found via matching in %Actor{name: target_actor, state: %ActorState{state: value} = actor_state}.
361370// 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 .
363372message ActorInvocation {
364373
365374 eigr.functions.protocol.actors.ActorId actor = 1 ;
366375
367- string command_name = 2 ;
376+ string action_name = 2 ;
368377
369378 Context current_context = 3 ;
370379
@@ -439,5 +448,3 @@ message RequestStatus {
439448
440449 string message = 2 ;
441450}
442-
443-
0 commit comments