Re: [racket-users] web server: database result paging

2015-04-24 Thread George Neuner
On 4/24/2015 1:29 PM, David Vanderson wrote: It sounds like you are not happy with the continuation model. No. I am just trying to understand how it works and to figure out whether I can work with it. The documentation sometimes is not clear and getting enough information sometimes is like

Re: [racket-users] web server: database result paging

2015-04-24 Thread David Vanderson
On 04/24/2015 06:39 AM, George Neuner wrote: Possibly. Sorry, I moved on to something else in the meantime and I have to get back to this. Is it required to use define or would let bound variables in start work also? George Yes - let bound variables would work the same. Thanks, Dave --

Re: [racket-users] web server: database result paging

2015-04-24 Thread David Vanderson
On 04/24/2015 08:13 AM, George Neuner wrote: I'm not using parameterize at all (at least not explicitly). I receive a web request that has up to 9 arguments contained in its bindings. (define (search request) (let* [ (params (request-bindings request)) (cookies

Re: [racket-users] web server: database result paging

2015-04-24 Thread Jay McCarthy
On Fri, Apr 24, 2015 at 8:13 AM, George Neuner wrote: > On 4/24/2015 7:36 AM, Jay McCarthy wrote: >> >> My point is that ONLY the result of make-parameter and parameterize is >> saved from the thread. In Racket a "parameter" has nothing to do with >> a function "argument". I believe you are confus

Re: [racket-users] web server: database result paging

2015-04-24 Thread George Neuner
On 4/24/2015 7:36 AM, Jay McCarthy wrote: My point is that ONLY the result of make-parameter and parameterize is saved from the thread. In Racket a "parameter" has nothing to do with a function "argument". I believe you are confused by the two when you say "There are 9 arguments...". If you follo

Re: [racket-users] web server: database result paging

2015-04-24 Thread Jay McCarthy
On Fri, Apr 24, 2015 at 7:32 AM, George Neuner wrote: > Hi Jay, > > On 4/24/2015 7:03 AM, Jay McCarthy wrote: >> >> On Fri, Apr 24, 2015 at 6:31 AM, George Neuner >> wrote: >> > On 4/23/2015 1:45 PM, Jay McCarthy wrote: >> > >> >> The values of the parameters are saved in the continuation and >>

Re: [racket-users] web server: database result paging

2015-04-24 Thread George Neuner
Hi Jay, On 4/24/2015 7:03 AM, Jay McCarthy wrote: On Fri, Apr 24, 2015 at 6:31 AM, George Neuner wrote: > On 4/23/2015 1:45 PM, Jay McCarthy wrote: > >> The values of the parameters are saved in the continuation and >> inherited from the thread. > > > That's going to be a problem because there'

Re: [racket-users] web server: database result paging

2015-04-24 Thread Jay McCarthy
On Fri, Apr 24, 2015 at 6:31 AM, George Neuner wrote: > On 4/23/2015 1:45 PM, Jay McCarthy wrote: >> >> On Thu, Apr 23, 2015 at 1:35 PM, David Vanderson >> wrote: >> >> > Jay - is there any connection between a saved continuation and the >> > thread >> > that created it? >> >> The values of the p

Re: [racket-users] web server: database result paging

2015-04-24 Thread George Neuner
Hi David, On 4/23/2015 1:35 PM, David Vanderson wrote: What I want to do is: create a hash representing the return object - data to return - URL for next page function (if applicable) - URL for prev page function (if applicable) convert the hash to a jsexpr

Re: [racket-users] web server: database result paging

2015-04-24 Thread George Neuner
On 4/23/2015 1:45 PM, Jay McCarthy wrote: On Thu, Apr 23, 2015 at 1:35 PM, David Vanderson wrote: > Jay - is there any connection between a saved continuation and the thread > that created it? The values of the parameters are saved in the continuation and inherited from the thread. That's go

Re: [racket-users] web server: database result paging

2015-04-23 Thread Jay McCarthy
On Thu, Apr 23, 2015 at 1:35 PM, David Vanderson wrote: > >> What I want to do is: >> >> create a hash representing the return object >> - data to return >> - URL for next page function (if applicable) >> - URL for prev page function (if applicable) >> convert the h

Re: [racket-users] web server: database result paging

2015-04-23 Thread David Vanderson
What I want to do is: create a hash representing the return object - data to return - URL for next page function (if applicable) - URL for prev page function (if applicable) convert the hash to a jsexpr send/suspend/dispatch the jsexpr #lang web-server/ins

Re: [racket-users] web server: database result paging

2015-04-22 Thread George Neuner
On 4/22/2015 8:12 PM, David Vanderson wrote: On 04/20/2015 05:54 AM, George Neuner wrote: I know I need a different response function. The question was whether embed/url is tied to HTML or can be used in a different context. The documentation (6.1.1) says: "When used inside page

Re: [racket-users] web server: database result paging

2015-04-22 Thread David Vanderson
On 04/20/2015 05:54 AM, George Neuner wrote: I know I need a different response function. The question was whether embed/url is tied to HTML or can be used in a different context. The documentation (6.1.1) says: "When used inside page syntactically, a rename transformer for the

Re: [racket-users] web server: database result paging

2015-04-20 Thread Jay McCarthy
On Mon, Apr 20, 2015 at 5:54 AM, George Neuner wrote: > Hi David, > > On 4/19/2015 9:51 AM, David Vanderson wrote: > > On 04/18/2015 12:34 PM, George Neuner wrote: > > However, to do this, I have to keep the initial id list across multiple > requests and that is where I've run into trouble. Thus

Re: [racket-users] web server: database result paging

2015-04-20 Thread George Neuner
Hi David, On 4/19/2015 9:51 AM, David Vanderson wrote: On 04/18/2015 12:34 PM, George Neuner wrote: However, to do this, I have to keep the initial id listacross multiple requestsand thatis where I've run into trouble. Thus far, I haven't had to use web server continuations. It seems like se

Re: [racket-users] web server: database result paging

2015-04-20 Thread Jay McCarthy
On Sat, Apr 18, 2015 at 6:11 PM, George Neuner wrote: > On 4/18/2015 5:09 PM, Jay McCarthy wrote: >> >> It is conceivable to grab the servlet's custodian and look at >> just the cost of the servlet, but unless there are many servlets, that >> will basically be the same value. > > > Does that work

Re: [racket-users] web server: database result paging

2015-04-19 Thread David Vanderson
On 04/18/2015 12:34 PM, George Neuner wrote: Hi all, I have an web server application in which I need to page results of a database query, but I also have to guarantee *exactly-once* statistical processing of each sent result row regardless of how many times it may be sent. Theresults are f

Re: [racket-users] web server: database result paging

2015-04-18 Thread George Neuner
On 4/18/2015 5:09 PM, Jay McCarthy wrote: It is conceivable to grab the servlet's custodian and look at just the cost of the servlet, but unless there are many servlets, that will basically be the same value. Does that work if there is just one instance of serve/servlet with a big dispatch-rul

Re: [racket-users] web server: database result paging

2015-04-18 Thread George Neuner
On 4/18/2015 5:09 PM, Jay McCarthy wrote: I think the code is pretty simple to read: https://github.com/racket/web-server/blob/master/web-server-lib/web-server/managers/lru.rkt#L42 :-)I just wouldn't know where to look for it. I don't have the Racket source generally available. Thanks

Re: [racket-users] web server: database result paging

2015-04-18 Thread Jay McCarthy
I think the code is pretty simple to read: https://github.com/racket/web-server/blob/master/web-server-lib/web-server/managers/lru.rkt#L42 It just uses current-memory-use, which looks at the entire VM's memory usage. It is conceivable to grab the servlet's custodian and look at just the cost of t

Re: [racket-users] web server: database result paging

2015-04-18 Thread George Neuner
Hi Jay, Thanks. One more question: is there a way to determine the size of the continuation cache so as to write a useful (should I) collect? function for create-LRU-manager?What statistic is the threshold-LRU-manager checking? George On 4/18/2015 4:28 PM, Jay McCarthy wrote: Unless y

Re: [racket-users] web server: database result paging

2015-04-18 Thread Jay McCarthy
Unless you want to just write a RESTful API, you want send/suspend/dispatch and you can make any kind of response you want. The documentation uses response/xexpr but you could put the URL anywhere you'd like, including sending it in an email or through carrier pigeon. Jay On Sat, Apr 18, 2015 at

Re: [racket-users] web server: database result paging

2015-04-18 Thread George Neuner
Hi Jay, WRT the database, I was just describing the situation in case anyone had a better idea than mine. For my own solution I think the basic question I need answered is how to generate URLs for 2 differently parameterized calls of the same function. I would have 2 distinct continuations

Re: [racket-users] web server: database result paging

2015-04-18 Thread Jay McCarthy
Hi George, The database question is independent of the continuation question and I'm not sure how to help you solve that problem. However, it sounds like you are asking if continuations can capture state like "display sublist 2" or "display sublist 3". They definitely can. Any of the continuation