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 摘要。