Skip to content

Commit b92ba89

Browse files
committed
finalize function
1 parent e082fcb commit b92ba89

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

examples/simple/mod.stof

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,9 @@ Weave simple: {
2828
self.background.output ?? ''
2929
}
3030

31-
Job finalize: {
32-
#[run]
33-
fn create_output() {
34-
const background = self.background();
35-
background.output = background.prompt.out();
31+
finalize: () => {
32+
if (self.background && self.background.prompt) {
33+
self.background.output = self.background.prompt.out();
3634
}
3735
}
3836

src/weave.stof

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ Weave: {
3535
list! jobs: []
3636

3737
#[run(200)]
38-
/// Finalize job, ran at the end after awaiting handles.
39-
Job finalize: null
38+
/// Finalize job or function, ran at the end after awaiting handles.
39+
Job | fn finalize: null
4040

4141
/// Async job handles, awaited before this weave pipeline ends.
4242
list! async_handles: []

0 commit comments

Comments
 (0)