[Gd-hackers] koala changes
Carl Gay
carlgay at gmail.com
Fri Feb 2 06:05:19 CET 2007
On 1/21/07, Chris Page <chris at chris-page.org> wrote:
> On Jan 18, 2007, at 08:15 AM, Carl Gay wrote:
>
> > let config = make(<http-server-configuration>);
> > load-config(config, "filename");
> > config.port := 8001; // optional
> > config.xml-rpc-enabled? := #t;
> > register-url(config, '/foo', my-responder);
> > register-xml-rpc-method(config, "blah", blah);
> > let server = make(<http-server>, config: config);
> > start-server(server); // returns immediately. optionally waits.
>
> I'm unclear what you're trying to say with this example, and what the
> relationships between the pieces of data are.
>
> Are you overriding the port and XML RPC values after loading them as
> part of the configuration file, or are they always supplied
> separately? What goes in a configuration?
>
> Why aren't more of the values supplied as initialization arguments to
> make?
>
> Why not do it more like this:
>
> let config = make(<http-server-configuration>,
> init-file: "filename",
> port: 8001,
> xml-rpc-enabled: #t,
> url-responders: vector(make(<url-responder>,
> url: "/foo",
> responder: my-
> responder)),
> xml-rpc-methods: vector(make(<xml-rpc-method>,
> blah-string: "blah",
> blah: blah)));
> let server = make(<http-server>, configuration: config);
> start-server(server);
Yes, I'll do something like this. Seems obvious now that I see it. I
do want to continue to allow changing the config options after
creating the config object though, especially for registering
responders and such.
> Alternatively, how about using a serialization library to read/write
> the server object?
I'm not quite sure what you have in mind here.
-Carl
More information about the hackers
mailing list