GoogleCloudPlatform / GoogleCloudPlatform/functions-framework-java

Consider supporting JEP 445

未关闭
#209 0 条评论 0 个 reaction 已指派 1 人 已被 @janell-chen 认领 在 GitHub 查看
enhancement P3
主要语言
Java
星标
154
派生
63
PR 合并指标
30 天内没有已合并 PR

描述

[JEP 445](https://openjdk.org/jeps/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:

```java
package com.example;

import com.google.cloud.functions.HttpFunction;
import com.google.cloud.functions.HttpRequest;
import com.google.cloud.functions.HttpResponse;

public class HelloWorld implements HttpFunction {
@Override
public void service(HttpRequest request, HttpResponse response)
throws Exception {
response.getWriter().write("Hello, World\n");
}
}
```

To something like this:

```java
import com.google.cloud.functions.FuncFramework;

void main() {
FuncFramework.http((req, res) -> response.getWriter().write("Hello, World\n"));
}
```

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。