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
<mailbox:///C:/Users/GW/Documents/Eudora/local/Mail/Local%20Folders/Drafts?number=0&part=1.2.2&filename=page.html>
syntactically, a rename transformer for the procedure embedding
function; otherwise, a syntax error."
That suggests embed/url can be used only in (X)HTML responses and
that I need to use something else to create dispatch URLs in regular code.
I think I see why that's confusing. The syntax parameter "embed/url",
is not being used in the code I sent. In that code, "embed/url" is the
name of a regular parameter to the lambda function being supplied to
send/suspend/dispatch. I probably should have used a different
parameter name. Does that make sense?
The final problem is how to ensure that I eventually get to
send/finishand clean up my thread. This particular function is
expected to be executed quite often. Does the browser app have to
invoke a URL that deliberately ends the thread or will the thread
end if/whenits continuations timeout?
What do you need to clean up? To be clear, there isn't a thread that
keeps running - the continuation is just some data, and like Jay
said, it will eventually be cleaned up. If you want to remove the
continuations manually, call send/forward or send/finish. See the
attached code. In particular, try running it, and then copying the
url to a second browser window. You'll see how two users have
different continuations.
My understanding is that serve/servlet executes dispatched functions
in separate threads. And I do see server multi-threading in practice
- e.g., a quick sequence of XHR calls made by the browser finishing in
different order. Timestamped in my application log as well as seen at
the browser.
So when I send/suspend* there will be a thread left suspended. Will
that thread context be cleaned up if the continuation expires? And
can I get a notification of which thread is involved? Or better yet,
get the thread restarted at yet another point so I can log that it has
finished processing. Are the threads just nuked invisibly or are they
terminated by an exception that I can catch?
My understanding is that when you do send/suspend*, the continuation is
saved, and the thread finishes. The continuation and thread are not
bound together. So when a request comes in to continue that
continuation, it will be a different (new?) thread that runs it.
Can you give an example of the processing that you want to know has been
finished? Do you want the thread serving the request to do some
processing after sending the response?
Thanks,
Dave
--
You received this message because you are subscribed to the Google Groups "Racket
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.