Re: WOLongResponsePage
Re: WOLongResponsePage
- Subject: Re: WOLongResponsePage
- From: Guido Neitzer <email@hidden>
- Date: Wed, 30 Jul 2008 09:39:25 -0600
On 30.07.2008, at 06:54, netBrackets wrote:
Isn't this something that would need to be done by the main RR
thread(s) on their own contexts?.
Depends on where you want to show fresh data ...
If so then how will the main threads know when a refretch needs to
be done?
Whenever it needs to be sure to have fresh (current data). It doesn't
know in advance.
I don't want them doing refetches for the whole 8 hours just in
case there is new data. Or is this a way for the background thread
to cause fetches to occur within the main OSC stack?
You can set up communication between the threads. Or keep a status in
a single table in the database, so other threads / applications can do
lookups for the status. There are many ways of handling that.
And refreshing means: when someone does an action in the application
YOU take care of getting fresh data. You need to get a concept on what
you define as "outdated". If you set the fetch timestamp lag low
enough and do fetches on reloads, the users will get fresh data - but
that involves many fetches.
Also I'd add some kind of notification system at the end of the
thread: send a mail, an IM message, trigger this:
http://tinyurl.com/yask2r
or whatever can be done to get your attention to the app.
Also, I really don't want to cause everything to have to refetch
when each little bit of new data becomes available, I want each bit
to be available as its posted by the background task, and is kind of
why I was thinking I'd need to use the same OSC and have the
background thread carefully lock and unlock it as needed. Or am I
thinking about something wrong here?
You making your life harder. That's just it. My rule for "safety" with
forked threads that do long running things on the database is to pass
in ONLY global ids and use a new OSC. Always. I can think about
exceptions when I stumble over them, but I actually never had to ...
As always: it depends on what you want. And to be honest, as long as
you're not keeping everything referenced in the session or application
but do fetches on the pages, you will get fresh data when it is
available and the existing data has an outdated timestamp. Does it
really matter if a user gets some updated information five minutes
later or earlier? If yes, you already have a problem that you need to
refetch all the time. Just don't let the cache time sitting at an hour
as it is by default.
cug
--
http://www.event-s.net
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden