GoogleCloudPlatform / GoogleCloudPlatform/functions-framework-java

Consider supporting JEP 445

Đang mở
#209 0 bình luận 0 reaction 1 người được giao Được @janell-chen nhận Xem trên GitHub
enhancement P3
Ngôn ngữ chính
Java
Star
154
Fork
63
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

[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"));
}
```

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.