Skip to content

Commit 537d3ef

Browse files
rest - Ticket [0880cb441c] - EF - New option -timeout.
Version bumped to 1.7.
1 parent ad6ad05 commit 537d3ef

File tree

6 files changed

+44
-9
lines changed

6 files changed

+44
-9
lines changed

embedded/md/tcllib/files/modules/rest/rest.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
[//000000001]: # (rest \- A framework for RESTful web services)
33
[//000000002]: # (Generated from file 'rest\.man' by tcllib/doctools with format 'markdown')
4-
[//000000003]: # (rest\(n\) 1\.6 tcllib "A framework for RESTful web services")
4+
[//000000003]: # (rest\(n\) 1\.7 tcllib "A framework for RESTful web services")
55

66
<hr> [ <a href="../../../../toc.md">Main Table Of Contents</a> &#124; <a
77
href="../../../toc.md">Table Of Contents</a> &#124; <a
@@ -39,7 +39,7 @@ rest \- define REST web APIs and call them inline or asychronously
3939
# <a name='synopsis'></a>SYNOPSIS
4040

4141
package require Tcl 8\.5 9
42-
package require rest ?1\.6?
42+
package require rest ?1\.7?
4343

4444
[__::rest::simple__ *url* *query* ?*config*? ?*body*?](#1)
4545
[__::rest::get__ *url* *query* ?*config*? ?*body*?](#2)
@@ -108,6 +108,8 @@ or process the returned data yourself
108108

109109
* __method__
110110

111+
* __timeout__
112+
111113
Two quick examples:
112114

113115
Example 1, Yahoo Boss:
@@ -467,6 +469,13 @@ Example, Yahoo Weather:
467469

468470
See __callback__ above for more information\.
469471

472+
* __timeout__
473+
474+
The value of this option determines whether to set a timeout on the HTTP
475+
call\. By default, no timeout is set\.
476+
477+
Timeout value is accepted in milliseconds\.
478+
470479
# <a name='section4'></a>Examples
471480

472481
Yahoo Geo:

idoc/man/files/modules/rest/rest.n

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'\"
22
'\" Generated from file 'rest\&.man' by tcllib/doctools with format 'nroff'
33
'\"
4-
.TH "rest" n 1\&.6 tcllib "A framework for RESTful web services"
4+
.TH "rest" n 1\&.7 tcllib "A framework for RESTful web services"
55
.\" The -*- nroff -*- definitions below are for supplemental macros used
66
.\" in Tcl/Tk manual entries.
77
.\"
@@ -275,7 +275,7 @@ rest \- define REST web APIs and call them inline or asychronously
275275
.SH SYNOPSIS
276276
package require \fBTcl 8\&.5 9\fR
277277
.sp
278-
package require \fBrest ?1\&.6?\fR
278+
package require \fBrest ?1\&.7?\fR
279279
.sp
280280
\fB::rest::simple\fR \fIurl\fR \fIquery\fR ?\fIconfig\fR? ?\fIbody\fR?
281281
.sp
@@ -357,6 +357,8 @@ The \fIconfig\fR dictionary supports the following keys
357357
\fBheaders\fR
358358
.TP
359359
\fBmethod\fR
360+
.TP
361+
\fBtimeout\fR
360362
.RE
361363
.sp
362364
Two quick examples:
@@ -708,6 +710,12 @@ when encountering an HTTP error, or not\&. The default is to not return
708710
the response body on error\&.
709711
.sp
710712
See \fBcallback\fR above for more information\&.
713+
.TP
714+
\fBtimeout\fR
715+
The value of this option determines whether to set a timeout on the HTTP
716+
call\&. By default, no timeout is set\&.
717+
.sp
718+
Timeout value is accepted in milliseconds\&.
711719
.RE
712720
.PP
713721
.SH EXAMPLES

idoc/www/tcllib/files/modules/rest/rest.html

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@
107107
&#124; <a href="../../../../toc2.html">Applications</a>
108108
] <hr>
109109
<div class="doctools">
110-
<h1 class="doctools_title">rest(n) 1.6 tcllib &quot;A framework for RESTful web services&quot;</h1>
110+
<h1 class="doctools_title">rest(n) 1.7 tcllib &quot;A framework for RESTful web services&quot;</h1>
111111
<div id="name" class="doctools_section"><h2><a name="name">Name</a></h2>
112112
<p>rest - define REST web APIs and call them inline or asychronously</p>
113113
</div>
@@ -129,7 +129,7 @@ <h1 class="doctools_title">rest(n) 1.6 tcllib &quot;A framework for RESTful web
129129
<div class="doctools_synopsis">
130130
<ul class="doctools_requirements">
131131
<li>package require <b class="pkgname">Tcl 8.5 9</b></li>
132-
<li>package require <b class="pkgname">rest <span class="opt">?1.6?</span></b></li>
132+
<li>package require <b class="pkgname">rest <span class="opt">?1.7?</span></b></li>
133133
</ul>
134134
<ul class="doctools_syntax">
135135
<li><a href="#1"><b class="cmd">::rest::simple</b> <i class="arg">url</i> <i class="arg">query</i> <span class="opt">?<i class="arg">config</i>?</span> <span class="opt">?<i class="arg">body</i>?</span></a></li>
@@ -200,6 +200,8 @@ <h1 class="doctools_title">rest(n) 1.6 tcllib &quot;A framework for RESTful web
200200
<dd></dd>
201201
<dt><b class="const">method</b></dt>
202202
<dd></dd>
203+
<dt><b class="const">timeout</b></dt>
204+
<dd></dd>
203205
</dl>
204206
<p>Two quick examples:</p>
205207
<p>Example 1, Yahoo Boss:</p>
@@ -474,6 +476,10 @@ <h1 class="doctools_title">rest(n) 1.6 tcllib &quot;A framework for RESTful web
474476
when encountering an HTTP error, or not. The default is to not return
475477
the response body on error.</p>
476478
<p>See <b class="const">callback</b> above for more information.</p></dd>
479+
<dt><b class="const">timeout</b></dt>
480+
<dd><p>The value of this option determines whether to set a timeout on the HTTP
481+
call. By default, no timeout is set.</p>
482+
<p>Timeout value is accepted in milliseconds.</p></dd>
477483
</dl></dd>
478484
</dl>
479485
</div>

modules/rest/pkgIndex.tcl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
if {![package vsatisfies [package provide Tcl] 8.5 9]} {return}
2-
package ifneeded rest 1.6 [list source [file join $dir rest.tcl]]
2+
package ifneeded rest 1.7 [list source [file join $dir rest.tcl]]

modules/rest/rest.man

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[comment {-*- tcl -*- doctools manpage}]
2-
[vset VERSION 1.6]
2+
[vset VERSION 1.7]
33
[manpage_begin rest n [vset VERSION]]
44
[moddesc {A framework for RESTful web services}]
55
[titledesc {define REST web APIs and call them inline or asychronously}]
@@ -55,6 +55,7 @@ dictionary must be present, however it is allowed to be empty.
5555
[def [const format]]
5656
[def [const headers]]
5757
[def [const method]]
58+
[def [const timeout]]
5859

5960
[comment {-- TODO -- describe the meaning of the various keys -- }]
6061
[list_end]
@@ -470,6 +471,14 @@ the response body on error.
470471

471472
[para] See [const callback] above for more information.
472473

474+
[comment @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@]
475+
[def [const timeout]]
476+
477+
The value of this option determines whether to set a timeout on the HTTP
478+
call. By default, no timeout is set.
479+
480+
[para] Timeout value is accepted in milliseconds.
481+
473482
[comment @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@]
474483
[list_end]
475484

modules/rest/rest.tcl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ package require json
1010
package require tdom
1111
package require base64
1212

13-
package provide rest 1.6
13+
package provide rest 1.7
1414

1515
namespace eval ::rest {
1616
namespace export create_interface parameters parse_opts save \
@@ -470,6 +470,9 @@ proc ::rest::_call {callback headers url query body error_body} {
470470
if {$callback != ""} {
471471
lappend opts -command [list ::rest::_callback {*}$callback]
472472
}
473+
if {[dict exists $config timeout]} {
474+
lappend opts -timeout [dict get $config timeout]
475+
}
473476

474477
#puts "headers $headers"
475478
#puts "opts $opts"

0 commit comments

Comments
 (0)