-
Notifications
You must be signed in to change notification settings - Fork 129
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support route dataframe to dedicate sfn instance (#704)
Adding `WriteWithTarget` api for `Source`, call it like: ```go source.WriteWithTarget(0x33, []byte("hello handler"), "target-id-1") ``` And sfn will receive the payload that be written by source like this: ```go sfn.SetWantedTarget("target-id-1") sfn.SetHandler(func(ctx serverless.Context) { fmt.Println(ctx.Data()) ctx.WriteWithTarget(0x34, []byte("hello next"), "target-id-2") }) ``` And the sfn that has called `sfn.SetWantedTarget("target-id-2")` will receive data from the above sfn. The route rules is: 1. find all sfn in tag. 2. if the sfn do not called `SetWantedTarget`, send data to the sfn. 3. if the sfn called `SetWantedTarget`, send the data only when `dataFrame.Metadata.Target == sfn.WantedTarget`. TODO: cli/wasm support. --------- Co-authored-by: venjiang <[email protected]>
- Loading branch information
Showing
19 changed files
with
275 additions
and
84 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
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
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
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
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
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
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
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
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
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
Oops, something went wrong.