I always wondered if Tcl's namespace mechanism could have been used for the
config file, and by your example below, it is tending towards that. Again, the
idea would be to utilize, where possible, existing Tcl mechanisms. So,
something like:
namespace eval fastpath {
set cache false
set cachemaxsize 5120000
set cachemaxentry 512000
set mmap false
}
.
.
.
namespace eval server::${servername} {
set connsperthread 0
set flushcontent false
set maxconnections 100
set maxthreads 10
set minthreads 0
set threadtimeout 120
}
What's good about this as well, is if you needed to access that variable later
on in the config file, then you could just use the FQ name, i.e.
set some_val [$fastpath::cache]
Haven't really thought this all the way through, so there might be some
pitfalls.
Just an idea,
--brett
----- Original Message ----
From: Vlad Seryakov <[EMAIL PROTECTED]>
To: [email protected]
Sent: Friday, August 10, 2007 3:37:07 PM
Subject: Re: [naviserver-devel] Proposal: just an idea about config syntax
Also if section command be made recursive-aware, so it will track
current position then the syntax can be event more eaiser
section "server/$servername" {
connsperthread 0
flushcontent false
maxconnections 100
maxthreads 10
minthreads 0
threadtimeout 120
section "modules" {
nsdb nsdb.so
nssock nssock.so
}
section "adp" {
map "/*.adp"
enableexpire false
}
section "tcl" {
nsvbuckets 16
library ${homedir}/modules/tcl
lazyloader false
}
section "module/nssock" {
port $port
address $address
}
}
Vlad Seryakov wrote:
> For example instead of this (or it could be used at the same time, it is
> not a replacement)
>
> ns_section "ns/fastpath"
> ns_param cache false
> ns_param cachemaxsize 5120000
> ns_param cachemaxentry 512000
> ns_param mmap false
>
> it may look like this (still Tcl)
>
> section "fastpath" {
> cache false
> cachemaxsize 5120000
> cachemaxentry 512000
> mmap false
> }
>
> section "server/${servername}" {
> connsperthread 0
> flushcontent false
> maxconnections 100
> maxthreads 10
> minthreads 0
> threadtimeout 120
> }
>
>
> As you can see this is Tcl command section
>
> proc section { name args } {
>
> ns_section ns/$name
> foreach { key val } $args {
> ns_param $key $val
> }
> }
>
> But config looks like more 21 century and more structured and easier to
> read. Very similar to lighttpd by the way.
>
>
--
Vlad Seryakov
[EMAIL PROTECTED]
http://www.crystalballinc.com/vlad/
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
naviserver-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/naviserver-devel
____________________________________________________________________________________
Need a vacation? Get great deals
to amazing places on Yahoo! Travel.
http://travel.yahoo.com/
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
naviserver-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/naviserver-devel