-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: add Deno reducer example (#156)
- Loading branch information
1 parent
75b990c
commit 99fb564
Showing
3 changed files
with
34 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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# Summary | ||
|
||
- [Introduction](./introduction.md) | ||
- [Reducers](./reducers/README.md) | ||
- [Deno](./reducers/deno.md) |
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,3 @@ | ||
# Reducers | ||
|
||
- [Deno](deno.md): custom reducers in js |
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,29 @@ | ||
# Deno | ||
|
||
With the deno reducer is possible to create a custom reducer for logics that the builtin reducers don't have support. This reducer is only enable with the deno feature on build. | ||
|
||
## Configuration | ||
|
||
Example of a configuration | ||
|
||
```toml | ||
[reducer] | ||
type = "Deno" | ||
main_module = "./examples/deno/enrich.js" | ||
use_async = true | ||
``` | ||
|
||
### Section: `reducer` | ||
|
||
- `type`: the literal value `Deno`. | ||
- `main_module`: the js file with the reducer logic | ||
- `use_async`: run the js in async mode | ||
|
||
|
||
## Run code | ||
|
||
To run the code with the deno will be necessary to use deno feature | ||
|
||
```sh | ||
cargo run --features=deno -- daemon --config ./examples/deno/enrich.js | ||
``` |