Skip to content

Commit 8ba1a33

Browse files
committed
Minor adjusts
1 parent 0e5b0eb commit 8ba1a33

4 files changed

Lines changed: 8 additions & 7 deletions

File tree

example/joe.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,10 @@ def hi(ctx: Context) -> Value:
3737

3838
@actor.action("setLanguage")
3939
def set_language(request: Request, ctx: Context) -> Value:
40+
print("Current State -> " + str(ctx.state))
41+
4042
reply = Reply()
4143
reply.response = "erlang"
42-
print("Current State -> " + str(ctx.state))
4344
new_state = State()
4445
new_state.languages.append("python")
45-
return Value().value(reply).state(new_state).reply()
46+
return Value().response(reply).state(new_state).reply()

example/spawn_example.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,8 @@
1414
request.language = "erlang"
1515

1616
spawn = Spawn()
17-
# .add_actor(joe_actor)
1817
spawn.port(8091).proxy_port(9003).actor_system(
19-
"spawn-system").add_actor(abstract).start()
18+
"spawn-system").add_actor(joe_actor).add_actor(abstract).start()
2019

2120
# Get abstract actor reference called mike
2221
mike_actor: ActorRef = Spawn.create_actor_ref(

example/unnamed_actor.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@
1414

1515
@abstract.action("setLanguage")
1616
def set_language(request: Request, ctx: Context) -> Value:
17+
print("Current State -> " + str(ctx.state))
18+
1719
reply = Reply()
1820
reply.response = "erlang"
19-
print("Current State -> " + str(ctx.state))
2021
new_state = State()
2122
new_state.languages.append("python")
22-
return Value().value(reply).state(new_state).reply()
23+
return Value().of(reply, new_state).reply()

spawn/eigr/functions/actors/api/value.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def metadata(self, metadata: Metadata):
6767
self.__metadata = metadata
6868
return self
6969

70-
def value(self, value):
70+
def response(self, value):
7171
self.__response = value
7272
return self
7373

0 commit comments

Comments
 (0)