TsgcWSPClient_sgc › Methods › StartTransaction
开始新事务;后续消息将排队直到提交或回滚。
procedure StartTransaction(const aChannel: string = '');
| 名称 | 类型 | 描述 |
|---|---|---|
aChannel | const string | 事务的可选频道范围。留空以启动默认事务。 |
为此客户端在服务器上打开一个事务。之后发送的消息将保存在队列中,只有在调用 Commit 时才分发给订阅者,或在调用 RollBack 时丢弃。
oProtocol.StartTransaction;
oProtocol.Publish('msg1', 'news');
oProtocol.Publish('msg2', 'news');
oProtocol.Commit;