igalshilman opened a new pull request #269:
URL: https://github.com/apache/flink-statefun/pull/269
## This PR adds a new remote functions SDK in JavaScript for `node js`.
* The following snippet demonstrate a minimal function that is invoked with
a `string` message and emits an egress message.
```javascript
const http = require("http");
const {StateFun, Message, Context, kafka_egress_message} =
require("./statefun");
statefun.bind({
typename: "fns/greeter",
async fn(context, message) {
const who = context.self.id;
const how = message.as_string();
context.send(kafka_egress_message({
typename: "egress/kafka",
key: who,
topic: "greets",
value: how
}));
}
});
http.createServer(statefun.handler()).listen(8000);
```
* In addition this PR adds a smoke e2e test for the JavaScript SDK.
* Docs and walkthrough will be followed in a separate PR.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]