Skip to content

Commit

Permalink
doc
Browse files Browse the repository at this point in the history
  • Loading branch information
gojuukaze committed Jul 12, 2021
1 parent f53f0ec commit 3e86d17
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
3 changes: 3 additions & 0 deletions docs/client.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@
// set delay time
taskId,err=client.SetTaskCtl(client.RunAfter, 2*time.Second).Send("group1","add",12,33)
// set expire time
taskId,err=client.SetTaskCtl(client.ExpireTime,time.Now().Add(4*time.Second)).Send("group1","add",12,33)
获取结果
----------

Expand Down
15 changes: 15 additions & 0 deletions docs/expire.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
任务过期时间
==============

目前只支持在client端设置过期时间,若任务发生重试且重试开始的时间超过了过期时间,任务会直接终止

.. code:: go
taskId, err :=client.SetTaskCtl(client.ExpireTime,time.Now().Add(4*time.Second)).Send("group1","add",12,33)
result, _ := client.GetResult(taskId, 2*time.Second, 300*time.Millisecond)
if result.Status == message.ResultStatus.Expired{
// do ...
}

0 comments on commit 3e86d17

Please sign in to comment.