annotate src/requests.tp @ 19:5a025e6c6f89

simple parallel requests limit test
author William Morgan <bill@mrgn.org>
date Fri, 09 Aug 2013 13:53:45 -0700
parents a0e66161bde0
children 92db3d1e8809
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
10
79c1db5e7ebd sending broken file for mike to check error
William Morgan <bill@mrgn.org>
parents:
diff changeset
1 #{
18
a0e66161bde0 for bug investigation
William Morgan <bill@mrgn.org>
parents: 17
diff changeset
2
a0e66161bde0 for bug investigation
William Morgan <bill@mrgn.org>
parents: 17
diff changeset
3 quote <- :str {
a0e66161bde0 for bug investigation
William Morgan <bill@mrgn.org>
parents: 17
diff changeset
4 "\"" . str . "\""
a0e66161bde0 for bug investigation
William Morgan <bill@mrgn.org>
parents: 17
diff changeset
5 }
a0e66161bde0 for bug investigation
William Morgan <bill@mrgn.org>
parents: 17
diff changeset
6
19
5a025e6c6f89 simple parallel requests limit test
William Morgan <bill@mrgn.org>
parents: 18
diff changeset
7 evalRequest <- :id args {
12
7d8b8f82cbef Help Bill work around some compiler bugs
Mike Pavone <pavone@retrodev.com>
parents: 10
diff changeset
8 #{
19
5a025e6c6f89 simple parallel requests limit test
William Morgan <bill@mrgn.org>
parents: 18
diff changeset
9 // id <- _id
12
7d8b8f82cbef Help Bill work around some compiler bugs
Mike Pavone <pavone@retrodev.com>
parents: 10
diff changeset
10 string <- {
18
a0e66161bde0 for bug investigation
William Morgan <bill@mrgn.org>
parents: 17
diff changeset
11 // idStr <- "a"//good
19
5a025e6c6f89 simple parallel requests limit test
William Morgan <bill@mrgn.org>
parents: 18
diff changeset
12 idStr <- quote("id") . quote(id)//segfault
18
a0e66161bde0 for bug investigation
William Morgan <bill@mrgn.org>
parents: 17
diff changeset
13 // idStr <- "\"id\":\"" . id . "\""// method not implemented
a0e66161bde0 for bug investigation
William Morgan <bill@mrgn.org>
parents: 17
diff changeset
14 // argsStr <- ""//arguments fold: "" with: :acc el {acc . el}
a0e66161bde0 for bug investigation
William Morgan <bill@mrgn.org>
parents: 17
diff changeset
15 argsStr <- "b"
a0e66161bde0 for bug investigation
William Morgan <bill@mrgn.org>
parents: 17
diff changeset
16 "{" . idStr . "," . argsStr . "}"
12
7d8b8f82cbef Help Bill work around some compiler bugs
Mike Pavone <pavone@retrodev.com>
parents: 10
diff changeset
17 }
7d8b8f82cbef Help Bill work around some compiler bugs
Mike Pavone <pavone@retrodev.com>
parents: 10
diff changeset
18 }
7d8b8f82cbef Help Bill work around some compiler bugs
Mike Pavone <pavone@retrodev.com>
parents: 10
diff changeset
19 }
10
79c1db5e7ebd sending broken file for mike to check error
William Morgan <bill@mrgn.org>
parents:
diff changeset
20
15
18ec9131f594 one more compiler bug for mike.
William Morgan <bill@mrgn.org>
parents: 14
diff changeset
21 guessRequest <- :id :prog {
18ec9131f594 one more compiler bug for mike.
William Morgan <bill@mrgn.org>
parents: 14
diff changeset
22 #{
18ec9131f594 one more compiler bug for mike.
William Morgan <bill@mrgn.org>
parents: 14
diff changeset
23 string <- {
17
566960135ea1 Small bit of cleanup now that the string escaping bug is fixed.
Mike Pavone <pavone@retrodev.com>
parents: 16
diff changeset
24 idStr <- "\"id\":\"" . id . "\""
566960135ea1 Small bit of cleanup now that the string escaping bug is fixed.
Mike Pavone <pavone@retrodev.com>
parents: 16
diff changeset
25 progStr <- "\"program\":\"" . prog . "\""
566960135ea1 Small bit of cleanup now that the string escaping bug is fixed.
Mike Pavone <pavone@retrodev.com>
parents: 16
diff changeset
26 "{" . idStr . "," . progStr . "}"
15
18ec9131f594 one more compiler bug for mike.
William Morgan <bill@mrgn.org>
parents: 14
diff changeset
27 }
18ec9131f594 one more compiler bug for mike.
William Morgan <bill@mrgn.org>
parents: 14
diff changeset
28 }
18ec9131f594 one more compiler bug for mike.
William Morgan <bill@mrgn.org>
parents: 14
diff changeset
29 }
18ec9131f594 one more compiler bug for mike.
William Morgan <bill@mrgn.org>
parents: 14
diff changeset
30
12
7d8b8f82cbef Help Bill work around some compiler bugs
Mike Pavone <pavone@retrodev.com>
parents: 10
diff changeset
31 main <- {
19
5a025e6c6f89 simple parallel requests limit test
William Morgan <bill@mrgn.org>
parents: 18
diff changeset
32 print: ((evalRequest: "someId" #[1 2 3]) string) . "\n"
15
18ec9131f594 one more compiler bug for mike.
William Morgan <bill@mrgn.org>
parents: 14
diff changeset
33 print: ((guessRequest: "someId" "someProg") string) . "\n"
12
7d8b8f82cbef Help Bill work around some compiler bugs
Mike Pavone <pavone@retrodev.com>
parents: 10
diff changeset
34 }
10
79c1db5e7ebd sending broken file for mike to check error
William Morgan <bill@mrgn.org>
parents:
diff changeset
35 }