你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

HttpReceiverOptions interface

用于配置 HTTP 接收器轮询消息的频率的选项结构。 除 drain 布尔值外,上述每个选项都是互斥的。 选项结构中只有一个 intervalatcronmanualPolling

这是通过调用 setOptions,将其作为 HttpTransportOptions 对象(位于 DeviceClientOptions 对象内部)中名为 receivePolicy 的属性来配置此配置。

属性

at

使用此选项可将接收方配置为在特定时间仅接收一次。

cron

使用 cron 格式的字符串

drain

指示是否应接收一条消息的所有消息都应清空的布尔值。

interval

轮询 Azure IoT 中心的间隔(以秒为单位)。

manualPolling

不轮询,而是依赖于调用 receive 方法的用户。

属性详细信息

at

使用此选项可将接收方配置为在特定时间仅接收一次。

at?: Date

属性值

Date

cron

使用 cron 格式的字符串

cron?: string

属性值

string

drain

指示是否应接收一条消息的所有消息都应清空的布尔值。

drain?: boolean

属性值

boolean

interval

轮询 Azure IoT 中心的间隔(以秒为单位)。

interval?: number

属性值

number

manualPolling

不轮询,而是依赖于调用 receive 方法的用户。

manualPolling?: boolean

属性值

boolean