Skip to content

Commit

Permalink
docs: update function compute streaming support situation
Browse files Browse the repository at this point in the history
  • Loading branch information
czy88840616 committed Sep 26, 2023
1 parent 1e179fb commit 3237365
Show file tree
Hide file tree
Showing 10 changed files with 60 additions and 26 deletions.
10 changes: 9 additions & 1 deletion site/docs/extensions/http-proxy.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,18 @@
| web 支持情况 | |
| ----------------- | --- |
| @midwayjs/koa ||
| @midwayjs/faas | |
| @midwayjs/faas | 💬 |
| @midwayjs/web ||
| @midwayjs/express ||

:::caution

💬 部分函数计算平台不支持流式请求响应,请参考对应平台能力。

:::



## 安装依赖

```bash
Expand Down
8 changes: 7 additions & 1 deletion site/docs/extensions/static_file.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,16 @@ midway 提供了基于 [koa-static-cache](https://github.com/koajs/static-cache)
| web 支持情况 | |
| ----------------- | ---- |
| @midwayjs/koa ||
| @midwayjs/faas | |
| @midwayjs/faas | 💬 |
| @midwayjs/web ||
| @midwayjs/express ||

:::caution

💬 部分函数计算平台不支持流式请求响应,请参考对应平台能力。

:::



## 安装依赖
Expand Down
8 changes: 7 additions & 1 deletion site/docs/extensions/upload.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,16 @@
| web 支持情况 | |
| ----------------- | ---- |
| @midwayjs/koa ||
| @midwayjs/faas | |
| @midwayjs/faas | 💬 |
| @midwayjs/web ||
| @midwayjs/express ||

:::caution

💬 部分函数计算平台不支持流式请求响应,请参考对应平台能力。

:::



## 安装依赖
Expand Down
10 changes: 5 additions & 5 deletions site/docs/pipe.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ import { Pipe, PipeTransform, TransformOptions } from '@midwayjs/core';

@Pipe()
export class ValidatePipe implements PipeTransform<T, R> {
transform(value: T, options:TransformOptions): R {
transform(value: T, options: TransformOptions): R {
return value;
}
}
Expand Down Expand Up @@ -103,9 +103,9 @@ export TransformOptions<OriginType = unknown> {
例如我们自定义一个 `RegValid` 参数装饰器,用于传入正则和另一个管道参数:

```typescript
import { PipeTransform, createCustomParamDecorator } from '@midwayjs/core';
import { PipeUnionTransform, createCustomParamDecorator } from '@midwayjs/core';

function RegValid(reg: Regexp, pipe: PipeTransform) {
function RegValid(reg: RegExp, pipe: PipeUnionTransform) {
return createCustomParamDecorator('reg-valid', {
reg,
}, {
Expand All @@ -126,8 +126,8 @@ function RegValid(reg: Regexp, pipe: PipeTransform) {
```typescript
@Pipe()
export class CutPipe implements PipeTransform {
transform(value: number, options:TransformOptions): string {
return String(value).splice(5);
transform(value: number, options: TransformOptions): string {
return String(value).slice(5);
}
}
```
Expand Down
10 changes: 5 additions & 5 deletions site/docs/serverless/aliyun_faas.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ import TabItem from '@theme/TabItem';

阿里云的函数计算部署类型比较多,根据运行的不同容器有以下几种。

| 名称 | 描述 | 部署媒介 |
| ------------------------------ | ------------------------------------------------------------ | --------------- |
| 内置运行时 | 只能部署函数接口,不需要自定义端口,构建出 zip 包给平台部署 | zip 包部署 |
| 自定义运行时(Custom Runtime) | 可以部署标准应用,启动 9000 端口,使用平台提供的系统镜像,构建出 zip 包给平台部署 | zip 包部署 |
| 自定义容器(Custom Container) | 可以部署标准应用,启动 9000 端口,自己控制所有环境依赖,构建出 Dockerfile 提供给平台部署 | Dockerfile 部署 |
| 名称 | 能力限制 | 描述 | 部署媒介 |
| ------------------------------ | ------------------------------------------------ | ------------------------------------------------------------ | --------------- |
| 内置运行时 | 不支持流式请求和响应;不支持太大的请求和响应入参 | 只能部署函数接口,不需要自定义端口,构建出 zip 包给平台部署 | zip 包部署 |
| 自定义运行时(Custom Runtime) | | 可以部署标准应用,启动 9000 端口,使用平台提供的系统镜像,构建出 zip 包给平台部署 | zip 包部署 |
| 自定义容器(Custom Container) | | 可以部署标准应用,启动 9000 端口,自己控制所有环境依赖,构建出 Dockerfile 提供给平台部署 | Dockerfile 部署 |

在平台上分别对应创建函数时的三种方式。

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,16 @@ Related information:
| Web support | |
| ----------------- | --- |
| @midwayjs/koa ||
| @midwayjs/faas | |
| @midwayjs/faas | 💬 |
| @midwayjs/web ||
| @midwayjs/express ||

:::caution

💬 Some function computing platforms do not support streaming request responses. Please refer to the corresponding platform capabilities.

:::

## Installation dependency

```bash
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,15 @@ Related information:
| Web support | |
| ----------------- | ---- |
| @midwayjs/koa ||
| @midwayjs/faas | |
| @midwayjs/faas | 💬 |
| @midwayjs/web ||
| @midwayjs/express ||

:::caution

💬 Some function computing platforms do not support streaming request responses. Please refer to the corresponding platform capabilities.

:::

## Installation dependency

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,15 @@ Related Information:
| web support | |
| ----------------- | ---- |
| @midwayjs/koa ||
| @midwayjs/faas | |
| @midwayjs/faas | 💬 |
| @midwayjs/web ||
| @midwayjs/express ||

:::caution

💬 Some function computing platforms do not support streaming request responses. Please refer to the corresponding platform capabilities.

:::

## Install dependencies

Expand Down
10 changes: 5 additions & 5 deletions site/i18n/en/docusaurus-plugin-content-docs/current/pipe.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,9 @@ In the options of the custom decorator, we can transparently pass the pipeline p
For example, we customize a `RegValid` parameter decorator to pass in the regex and another pipeline parameter:

```typescript
import { PipeTransform, createCustomParamDecorator } from '@midwayjs/core';
import { PipeUnionTransform, createCustomParamDecorator } from '@midwayjs/core';

function RegValid(reg: Regexp, pipe: PipeTransform) {
function RegValid(reg: RegExp, pipe: PipeUnionTransform) {
return createCustomParamDecorator('reg-valid', {
reg,
}, {
Expand All @@ -126,8 +126,8 @@ In addition, we define another pipeline for intercepting data.
```typescript
@Pipe()
export class CutPipe implements PipeTransform {
transform(value: number, options:TransformOptions): string {
return String(value).splice(5);
transform(value: number, options: TransformOptions): string {
return String(value).slice(5);
}
}
```
Expand Down Expand Up @@ -187,4 +187,4 @@ class UserService {
}

invoke(13712345678) => '345678'
```
```
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ The following are common methods of using, testing, and deploying function trigg

Alibaba Cloud has many types of function computing deployments, including the following types according to the different containers they run.

| Name | Description | Deployment Media |
| ---------------- | ------------------------------------------------------------ | ---------------------- |
| Built-in runtime | Only function interfaces can be deployed, no custom ports are required, zip packages are built for platform deployment | zip package deployment |
| Custom Runtime | You can deploy standard applications, start port 9000, use the system image provided by the platform, and build a zip package for platform deployment | zip package deployment |
| Custom Container | You can deploy standard applications, start port 9000, control all environmental dependencies yourself, and build a Dockerfile for platform deployment | Dockerfile deployment |
| Name | Functional limitations | Description | Deployment Media |
| ---------------- | ------------------------------------------------------------ | ------------------------------------------------------------ | ---------------------- |
| Built-in runtime | Streaming requests and responses are not supported; requests and responses that are too large are not supported. | Only function interfaces can be deployed, no custom ports are required, zip packages are built for platform deployment | zip package deployment |
| Custom Runtime | | You can deploy standard applications, start port 9000, use the system image provided by the platform, and build a zip package for platform deployment | zip package deployment |
| Custom Container | | You can deploy standard applications, start port 9000, control all environmental dependencies yourself, and build a Dockerfile for platform deployment | Dockerfile deployment |

There are three ways to create functions on the platform.

Expand Down

0 comments on commit 3237365

Please sign in to comment.