Re: Server push
From: Michele (michele_betti_at_telespazio.it)
Date: 10/28/03
- Next message: kecebong: "Re: compile php 4.3.3 with gd"
- Previous message: Alan Little: "Re: how does one trap for out-of-memory errors?"
- In reply to: Erwin Moller: "Re: Server push"
- Next in thread: Erwin Moller: "Re: Server push"
- Reply: Erwin Moller: "Re: Server push"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 28 Oct 2003 04:16:59 -0800
Hi Erwin,
I know the "hidden" periodic check on the server would be the easiest
solution. The hard part would be the tuning of periodicity interval.
Actually, I've been thinking about a different solution, exploiting
PHP socket functions: I would have a server socket open in the
"hidden" frame, waiting for update alerts. Any time a change in the
schedule is performed by planner users, a PHP script could connect to
the socket, triggering a refresh of the task list page by the watcher
user.
Although this could save the day, it sounds sort of a dirty trick to
me. I would seek a cleaner solution first (if available).
Michelle
Erwin Moller <since_humans_read_this_I_am_spammed_too_much@spamyourself.com> wrote in message news:<3f97daf3$0$58716$e4fe514c@news.xs4all.nl>...
> Michele wrote:
>
> > Hi all,
> > I have developed a PHP-based website where a "planner" user can make
> > up schedules of activities to be performed, storing them into MySQL
> > tables. Afterwards, other "watcher" users can connect to the website
> > and retrieve closest task due time, and keep retrieving next task
> > after each one has been performed.
> > The problem arises if the planner asynchronously changes the schedule,
> > e.g. deleting the task "watcher" users consider to be the next one, or
> > inserting a closer one. How would watchers know, without a cyclic
> > check on MySQL schedule table about task validity? I would need a sort
> > of asynchronous server-pushing tecnhique towards watcher's browser
> > when any schedule modification occurs.
> > Would you say this could be done with PHP alone?
> >
> > Thanks a lot in advance
> >
> > Michelle
>
> Hi Michelle,
>
> My first response would be: "Let the planners think before they shedule."
> That would save you a lot of trouble, wouldn't it?
> Anyway, this is the real world.
>
> No such thing as real serverpush with PHP to my knowledge, but if your
> browser is open during the task of your 'watcher-users', you can let the
> browserwindow periodically check the server and ask if the task is still
> valid.
> If this is what you call "cyclic check on MySQL schedule table" then I think
> you cannot work around it.
>
> This can easily be accomplished by using a frameset, and make one frame
> invissible. In that frame you call a php-script that checks the validity of
> the task, and when it is not valid, you can return code that for example
> creates a javascript allert.
>
>
> I hope this helps. :-)
>
> Good luck and regards,
> Erwin Moller
- Next message: kecebong: "Re: compile php 4.3.3 with gd"
- Previous message: Alan Little: "Re: how does one trap for out-of-memory errors?"
- In reply to: Erwin Moller: "Re: Server push"
- Next in thread: Erwin Moller: "Re: Server push"
- Reply: Erwin Moller: "Re: Server push"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|