Does "send in time" work on server?

Are you using LiveCode to create server scripts or CGIs?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
ctflatt
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 243
Joined: Sun Dec 06, 2009 12:24 am
Location: Fredericktown, MO
Contact:

Does "send in time" work on server?

Post by ctflatt » Mon Dec 05, 2011 11:37 am

Good morning, everyone!

I am trying to implement a send-in-time command on the server, but it seems to be failing.

Is this supported?

Thanks,

Todd

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: Does "send in time" work on server?

Post by Mark » Mon Dec 05, 2011 11:50 am

Hi Todd,

The instance of the engine executing the script will run only as long as the original handler runs. When the handler stops, the message that was sent "in time" could run, but the programme quits before it actually catches that message. So, it is probably impossible to use send in time. I am not really an expert in server scripting with irev, because I always use PHP instead of irev. Perhaps someone else knows a way around this problem.

Kind regards,

Mark
Last edited by Mark on Mon Dec 05, 2011 12:40 pm, edited 1 time in total.
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

bangkok
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 937
Joined: Fri Aug 15, 2008 7:15 am

Re: Does "send in time" work on server?

Post by bangkok » Mon Dec 05, 2011 12:33 pm

I've tried.

No success.

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9852
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Does "send in time" work on server?

Post by FourthWorld » Mon Dec 05, 2011 2:48 pm

"send <msg> in <time>" is problematic in pretty much all CGIs given the nature of that interface.

What problem are you trying to solve?

Would "wait" work?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

ctflatt
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 243
Joined: Sun Dec 06, 2009 12:24 am
Location: Fredericktown, MO
Contact:

Re: Does "send in time" work on server?

Post by ctflatt » Mon Dec 05, 2011 7:38 pm

Richard:

Thanks!

"Wait" may work.

I am trying to figure out a workaround to Apple's Push Notification service for $$$ reasons...

The app posts to my .lc page, which is supposed to send an email via .php sendmail 45 minutes later, along with an answer dialog.

The .php sendmail is working correctly.

When I use "send in time" the .lc page breaks, but when I tried "wait" it works (at 15 seconds for testing), but the response back to the answer dialog is delayed 15 seconds, as well)...

Any ideas, or am I hopelessly lost?

Does wait 2700 seconds tie up the server inordinately? LOL!

:Todd

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: Does "send in time" work on server?

Post by Mark » Mon Dec 05, 2011 7:58 pm

Hi Todd,
Does wait 2700 seconds tie up the server inordinately? LOL!
Well, it does use resources. If you are going to have very many clients then I'd use a cron job that runs once a minute to check if there are any pending e-mails in the database that should be sent now and sends them if the right amount of time has passed.

Kind regards,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

ctflatt
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 243
Joined: Sun Dec 06, 2009 12:24 am
Location: Fredericktown, MO
Contact:

Re: Does "send in time" work on server?

Post by ctflatt » Mon Dec 05, 2011 8:09 pm

Mark:

Would the cron job trigger a lc script?

:Todd

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: Does "send in time" work on server?

Post by Mark » Mon Dec 05, 2011 8:16 pm

Todd,

This should be possible. If it is possible to run a LC script from the command line, then it is also possible to use a cron job.

Best regards,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

Post Reply

Return to “CGIs and the Server”