electronic.alchemy :: Breakpointing
where the past meets the future
pike > Fins > Developer > Breakpointing


Created by hww3. Last updated by hww3, 16 years ago. Version #2.

Fins supports request breakpointing, which allows you to pause a request in flight and query and modify it.

To enable breakpointing, add the following to your application's configuration file:


Then when you restart your app, you should see a line that says the breakpoint server is being started. Once you see that, you can telnet to that port:

bash-2.05$ telnet buoy.riverweb.com 12345
Connected to buoy.riverweb.com.
Escape character is '^]'.
Welcome to Fins Breakpoint Service.

Now, it's just waiting for a request to hit a breakpoint. To add a breakpoint, you add something like this in your controller's event:

  app->breakpoint("some description", (["id": id, "response": response ]));

...and when your app hits that point, your telnet session will come alive with a hilfe prompt. You can access the request object as "id" and the response as "response". You can access request variables and change the response (though if code later on in the request modifies it, your changes may be overwritten.)

For example:

Welcome to Fins Breakpoint Service.
Breakpoint on test
> id;
(1) Result: Fins.HTTPRequest("GET" "/space/start/2006-04-25/2")
> id->variables;
(2) Result: ([ ])
> id->misc;
(3) Result: ([ /* 5 elements */
              "_session": Session(6d5581d44dab127d7fb1, ([ ])),
              "current_page": "start/2006-04-25/2",
              "current_page_object": object(230),
              "session_id": "6d5581d44dab127d7fb1",
              "session_variables": ([ ])
> id->misc->current_page_object["title"];
(4) Result: "Collaborative editing for Mac: on sale, too!"
> go

The only limitation to using breakpoints is that it uses threads. Not a big deal, just something to be aware of.

Not categorized | RSS Feed | BackLinks

comments powered by Disqus