Skip to Content
Dapr学习手册
book

Dapr学习手册

by Haishi Bai, Yaron Schneider
November 2021
Beginner to intermediate
239 pages
4h 15m
Chinese
China Electric Power Press Ltd.
Content preview from Dapr学习手册
Actor
169
Reminders
的工作方式与计时器类似,但它们是持久化的。它们不会与
actor
实例一起消亡。反之,它们始终存在,除非被显式地反注册,如下一节所述。
5.2.4 Reminder
与计时器不同,
Reminder
是持久化的。
它用于按指定的时间间隔来安排工作。
如果一个
actor
被杀死或被调度到其他主机时,
reminder
被保留下来并在触
发时开启调用(并因此重新创建
actor
)。以下示例显示如何使用
HTTP
创建
actor
reminder
curl http://localhost:3500/v1.0/actors/stormtrooper/50/reminders/checkRebels \
-H "Content-Type: application/json"
-d '{
"data": "someData",
"dueTime": "1m",
"period": "20s"
}'
本示例在类型为
Stormtrooper ID
50
actor
上创建了一个
checkRebels
reminder
。传递给
Dapr
运行时的数据包括了
dutTime
(表示启动这个
reminder
之前要等待的时间)和
period
(用于设置重复时间间隔)。
你可以使用
HTTP
请求显式地删除
reminder
以下示例介绍了如何删除
checkRebels reminder
curl http://localhost:3500/v1.0/actors/stormtrooper/50/reminders/checkRebels ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

流畅的Python(第2版)

流畅的Python(第2版)

Luciano Ramalho
数据科学原理

数据科学原理

Posts & Telecom Press, Sinan Ozdemir
Python预测分析实战

Python预测分析实战

Posts & Telecom Press, Alvaro Fuentes
机器学习开发者指南

机器学习开发者指南

Posts & Telecom Press, Rodolfo Bonnin

Publisher Resources

ISBN: 9787519859367