-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
support openfunction framework #1
Conversation
e006336
to
1d93736
Compare
Signed-off-by: wanjunlei@kubesphere.io Signed-off-by: wanjunlei <wanjunlei@kubesphere.io>
Signed-off-by: wanjunlei <wanjunlei@kubesphere.io>
Signed-off-by: wanjunlei <wanjunlei@kubesphere.io>
* @param data Data String | ||
* @return Error | ||
*/ | ||
Error send(String outputName, String data); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then we can use FuncContext instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There has a class named FunctionContex.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's the difference between FunctionContex and UserContext?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's ok if user function can only see context interface
No description provided.