Skip to content

Consider supporting JEP 445 #209

Description

@josephlewis42

JEP 445 (Preview in JDK 21) introduces unnamed classes and instance main methods. This could be a boon to writing functions if done right changing our result from this:

packagecom.example;
importcom.google.cloud.functions.HttpFunction;
importcom.google.cloud.functions.HttpRequest;
importcom.google.cloud.functions.HttpResponse;
publicclassHelloWorldimplementsHttpFunction {
@Overridepublicvoidservice(HttpRequestrequest, HttpResponseresponse)
throwsException {
response.getWriter().write("Hello, World\n");
}
}

To something like this:

importcom.google.cloud.functions.FuncFramework;
voidmain() {
FuncFramework.http((req, res) -> response.getWriter().write("Hello, World\n"));
}

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions