Skip to content

Commit 3419d51

Browse files
committed
address feedback
1 parent 1636b97 commit 3419d51

File tree

3 files changed

+23
-19
lines changed

3 files changed

+23
-19
lines changed

docs/02_concepts/code/01_class_manual.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,20 @@
66
async def main() -> None:
77
await Actor.init()
88

9-
# Get input
10-
actor_input = await Actor.get_input()
11-
Actor.log.info('Actor input: %s', actor_input)
9+
try:
10+
# Get input
11+
actor_input = await Actor.get_input()
12+
Actor.log.info('Actor input: %s', actor_input)
1213

13-
# Your Actor logic here
14-
data = {'message': 'Hello from Actor!', 'input': actor_input}
15-
await Actor.push_data(data)
14+
# Your Actor logic here
15+
data = {'message': 'Hello from Actor!', 'input': actor_input}
16+
await Actor.push_data(data)
1617

17-
# Set status message
18-
await Actor.set_status_message('Actor completed successfully')
18+
# Set status message
19+
await Actor.set_status_message('Actor completed successfully')
1920

20-
await Actor.exit()
21+
finally:
22+
await Actor.exit()
2123

2224

2325
if __name__ == '__main__':

docs/02_concepts/code/01_instance_context.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ async def main() -> None:
2020
await actor.push_data(data)
2121

2222
# Set status message
23-
await Actor.set_status_message('Actor completed successfully')
23+
await actor.set_status_message('Actor completed successfully')
2424

2525

2626
if __name__ == '__main__':

docs/02_concepts/code/01_instance_manual.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,20 @@ async def main() -> None:
1212

1313
await actor.init()
1414

15-
# Get input
16-
actor_input = await actor.get_input()
17-
actor.log.info('Actor input: %s', actor_input)
15+
try:
16+
# Get input
17+
actor_input = await actor.get_input()
18+
actor.log.info('Actor input: %s', actor_input)
1819

19-
# Your Actor logic here
20-
data = {'message': 'Hello from Actor!', 'input': actor_input}
21-
await actor.push_data(data)
20+
# Your Actor logic here
21+
data = {'message': 'Hello from Actor!', 'input': actor_input}
22+
await actor.push_data(data)
2223

23-
# Set status message
24-
await actor.set_status_message('Actor completed successfully')
24+
# Set status message
25+
await actor.set_status_message('Actor completed successfully')
2526

26-
await actor.exit()
27+
finally:
28+
await actor.exit()
2729

2830

2931
if __name__ == '__main__':

0 commit comments

Comments
 (0)