-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added instructions for triggering contained reactors
- Loading branch information
1 parent
252f965
commit 41c4168
Showing
6 changed files
with
167 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
target C | ||
reactor Inside { | ||
input x: int | ||
reaction(x) {= | ||
printf("Received %d\n", x->value);= | ||
=} | ||
} | ||
main reactor { | ||
i = new Inside() | ||
reaction(startup) -> i.x {= | ||
lf_set(i.x, 42); | ||
=} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
target Cpp | ||
reactor Inside { | ||
input x: int | ||
reaction(x) {= | ||
std::cout << "Received " << std::to_string(*x.get()) << std::endl; | ||
=} | ||
} | ||
main reactor { | ||
i = new Inside() | ||
reaction(startup) -> i.x {= | ||
i.x.set(42); | ||
=} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
target Python | ||
reactor Inside { | ||
input x | ||
reaction(x) {= | ||
print(f"Received {x.value}") | ||
=} | ||
} | ||
main reactor { | ||
i = new Inside() | ||
reaction(startup) -> i.x {= | ||
i.x.set(42); | ||
=} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
target Rust | ||
reactor Inside { | ||
input x: u32 | ||
reaction(x) {= | ||
println!("Received {}", ctx.get(x).unwrap()); | ||
=} | ||
} | ||
main reactor { | ||
i = new Inside() | ||
reaction(startup) -> i.x {= | ||
ctx.set(i__x, 42); | ||
=} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
target TypeScript | ||
reactor Inside { | ||
input x: number | ||
reaction(x) {= | ||
console.log("Received ${x}"); | ||
=} | ||
} | ||
main reactor { | ||
i = new Inside() | ||
reaction(startup) -> i.x {= | ||
i.x = 42 | ||
=} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters