We do something fairly strange on our commands that might be useful
here.  We treat the string argument for a duration or timer as having 3
potential signs: "-", "+", and "@".  Dash and plus *always* mean
relative-to-now.  @ always means absolute time.

Any given option or argument documents whether its *default sign* is
-,+, or @.  For expirations, we usually say that the default is "+". So
"-expiry 5" is 5 seconds from now, while "-expiry @5" expired a long
time ago.

And it makes parsing a timer or duration a standard operation throughout
our code.  Unfortunately, it's in our C++ stuff, so not really suitable
for the Naviserver core.

Hope this helps --
-- ReC

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Stephen Deasey
Sent: Saturday, July 08, 2006 3:05 PM
To: naviserver-devel@lists.sourceforge.net
Subject: Re: [naviserver-devel] ns_cache is still broken

On 6/28/06, Vlad Seryakov <[EMAIL PROTECTED]> wrote:
> I also have question what is the meaning of changing -ttl
> relativeSeconds into -expires absolutetime.
>
> Now Tcl code looks bloated with all -expires [expr [ns_time]+3600]
lines
> not counting that this is much slower than doing such incrementing C.
>
> May be we can keep both parameters, -ttl as relative and -expires as
> absolute?
>


I changed it to make -timeout and -expiry regular.  But you're right,
it's ugly when you just want to specify an offset from now such as +3
seconds.

I've changed it in CVS so that small -timeout and -expiry times are
treated as offsets from now, and large values are treated as absolute
times in the future.


------------------------------------------------------------------------
-
Using Tomcat but need to do more? Need to support web services,
security?
Get stuff done quickly with pre-integrated technology to make your job
easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache
Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
naviserver-devel mailing list
naviserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/naviserver-devel

Reply via email to