Documentation

socket.from() function

socket.from() 函数

socket.from() returns data from a socket connection and outputs a stream of tables given a specified decoder.

socket.from() 函数从套接字连接返回数据,并根据指定的解码器输出表格流。

The function produces a single table for everything that it receives from the start to the end of the connection.

该函数为从连接开始到结束接收的所有内容生成单个表格。

Function type signature

函数类型签名

(url: string, ?decoder: string) => stream[A]

For more information, see Function type signatures.

有关更多信息,请参阅 函数类型签名

Parameters

参数

url

(Required) URL to return data from.

(Required) 必需) 要从中返回数据的 URL。

Supported URL schemes

支持的 URL 方案:

  • tcp
  • unix

decoder

Decoder to use to parse returned data into a stream of tables.

用于将返回的数据解析为表格流的解码器。

Supported decoders

支持的解码器:

  • csv
  • line

Examples

示例

Query annotated CSV from a socket connection

从套接字连接查询带注释的 CSV

import "socket"

socket.from(url: "tcp://127.0.0.1:1234", decoder: "csv")

Query line protocol from a socket connection

从套接字连接查询行协议

import "socket"

socket.from(url: "tcp://127.0.0.1:1234", decoder: "line")

Was this page helpful?

此页面是否对您有帮助?


The future of Flux

Flux 的未来

Flux is going into maintenance mode. You can continue using it as you currently are without any changes to your code.

Flux 即将进入维护模式。您可以继续像现在这样使用它,而无需对您的代码进行任何更改。

Read more

阅读更多

Now Generally Available

现已全面上市

InfluxDB 3 Core and Enterprise

InfluxDB 3 Core 和 Enterprise

Start fast. Scale faster.

快速启动。更快扩展。

Get the Updates

获取更新

InfluxDB 3 Core is an open source, high-speed, recent-data engine that collects and processes data in real-time and persists it to local disk or object storage. InfluxDB 3 Enterprise builds on Core’s foundation, adding high availability, read replicas, enhanced security, and data compaction for faster queries and optimized storage. A free tier of InfluxDB 3 Enterprise is available for non-commercial at-home or hobbyist use.

InfluxDB 3 Core 是一个开源、高速、近实时数据引擎,可实时收集和处理数据,并将其持久化到本地磁盘或对象存储。InfluxDB 3 Enterprise 构建在 Core 的基础上,增加了高可用性、读取副本、增强的安全性以及数据压缩,从而实现更快的查询和优化的存储。InfluxDB 3 Enterprise 的免费层可供非商业家庭或业余爱好者使用。

For more information, check out

有关更多信息,请查看