support openfunction framework#1
Conversation
e006336 to
1d93736
Compare
Signed-off-by: [email protected] Signed-off-by: wanjunlei <[email protected]>
Signed-off-by: wanjunlei <[email protected]>
Signed-off-by: wanjunlei <[email protected]>
| * @param data Data String | ||
| * @return Error | ||
| */ | ||
| Error send(String outputName, String data); |
There was a problem hiding this comment.
OpenFunction/functions-framework#21 (comment)
we need to add publish for pubsub and output for binding.
You can add this in another PR
|
|
||
| private static final Logger logger = Logger.getLogger("dev.openfunction.invoker"); | ||
|
|
||
| private static final Map<String, Boolean> bindingQueueComponents = Map.of( |
There was a problem hiding this comment.
this hardcode bindingqueuecomponents is only used to determine if it's tracable?
@tpiperatgod Go FF has similar logic or use something else?
There was a problem hiding this comment.
It is similar to the go framework.
https://github.com/OpenFunction/functions-framework-go/blob/main/context/context.go#L25
At present, the tracing is not implemented, and it will be redesigned in the future.
| @@ -0,0 +1,50 @@ | |||
| apiVersion: core.openfunction.io/v1beta1 | |||
| kind: Function | |||
| metadata: | |||
There was a problem hiding this comment.
We can move these samples to the samples repo later and update docs like https://openfunction.dev/docs/getting-started/quickstarts/ and https://openfunction.dev/docs/concepts/function_signatures/
There was a problem hiding this comment.
The samples and docs will be completed later.
| import java.util.logging.Level; | ||
| import java.util.logging.Logger; | ||
|
|
||
| public class UserContext implements Context { |
There was a problem hiding this comment.
I think the UserContext can just be renamed to Context including class name and filename and variable name(lowercase)
There was a problem hiding this comment.
This does not conform to java's naming convention, interface implementation should not have the same name as the interface.
There was a problem hiding this comment.
Then we can use FuncContext instead?
There was a problem hiding this comment.
There has a class named FunctionContex.
There was a problem hiding this comment.
what's the difference between FunctionContex and UserContext?
There was a problem hiding this comment.
The FunctionContex is the structure of FUNC_CONTEXT, UserContext implement the Context interface and will pass to the function.
There was a problem hiding this comment.
That's ok if user function can only see context interface
No description provided.