未验证 提交 383e685b 编写于 作者: W wade zhang 提交者: GitHub

Merge pull request #12036 from taosdata/docs/dingbo8128-patch-3-6

docs: update subscribe_demo.c
// A simple demo for asynchronous subscription.
// compile with:
// gcc -o subscribe_demo subscribe_demo.c -ltaos
......@@ -52,6 +53,8 @@ int main() {
int interval = 2000; // consumption interval in microseconds.
TAOS_SUB* tsub = taos_subscribe(taos, restart, topic, sql, subscribe_callback, NULL, interval);
// wait for insert from others process. you can open TDengine CLI to insert some records for test.
getchar(); // press Enter to stop
printf("total rows consumed: %d\n", nTotalRows);
......@@ -60,4 +63,4 @@ int main() {
taos_close(taos);
taos_cleanup();
}
\ No newline at end of file
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册