Skip to content

Commit

Permalink
Update tutorial-12-mysql_cli.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Barenboim authored Sep 10, 2020
1 parent 7b6133f commit 4beb26c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions docs/tutorial-12-mysql_cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,15 @@ public:
WFMySQLTask *create_disconnect_task(mysql_callback_t callback);
}
~~~
WFMySQLConnection相当于一个二级工厂,我们约定任何工厂对象的生命周期无需保持到任务结束,以下代码完全合法:
~~~cpp
WFMySQLConnection *conn = new WFMySQLConnection(1234);
conn->init(url);
auto *task = conn->create_query_task("SELECT * from table", my_callback);
conn->deinit();
delete conn;
task->start();
~~~

### 3. 注意事项

Expand Down

0 comments on commit 4beb26c

Please sign in to comment.