Can you send a message to your own controller?

Are you using LiveCode to create server scripts or CGIs?

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller, robinmiller

Post Reply
William Jamieson
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 211
Joined: Fri Feb 01, 2013 1:31 am
Location: Palo Alto, CA put williamdjamieso into tEmail / put n@gmail.com after tEmail/ revmail tEmail
Contact:

Can you send a message to your own controller?

Post by William Jamieson » Mon Nov 02, 2015 2:24 am

Do you know if the controller scripts using RevIgniter can send messages to each other, or within the same controller at a different time?

Example: Controller 1: events, controller 2: users

command createEvent
get rigLoadDatabase()
Do SQL

send "UpdateUser" to users.lc
end CreateEvent


or

command createEvent
get rigLoadDatabase()
Do SQL

send "UpdateEvent" to me in 300 seconds
end CreateEvent

What do you think will happen?

-Will

rabit
Posts: 17
Joined: Wed May 31, 2006 8:30 am

Re: Can you send a message to your own controller?

Post by rabit » Mon Nov 02, 2015 4:05 pm

Hi William,

if you look at the application flow chart http://revigniter.com/userGuide/overview/appflow.html
of revIgniter you see that there is only one application controller loaded at one time.
This means handlers of other controllers are not available. But even if you would
include other controller files, like users.lc in your case, you can not send commands
to files like:

Code: Select all

send "UpdateUser" to users.lc
And send in time does not work with server either. May be I could
help if you briefly explain what you are trying to achieve.

Ralf

William Jamieson
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 211
Joined: Fri Feb 01, 2013 1:31 am
Location: Palo Alto, CA put williamdjamieso into tEmail / put n@gmail.com after tEmail/ revmail tEmail
Contact:

Re: Can you send a message to your own controller?

Post by William Jamieson » Mon Nov 02, 2015 7:31 pm

I was seeing if this would be a way to create a timed event as a lazy form of a trigger where processing could happen after the user gets their feedback. For example, the user uploads a video, the server returns true, then the server could then be activated and told to convert the video.

I was trying to see if there is a lazy way, but I don't think so. What do you think the best way would be?

-Will

rabit
Posts: 17
Joined: Wed May 31, 2006 8:30 am

Re: Can you send a message to your own controller?

Post by rabit » Tue Nov 03, 2015 5:23 pm

Check the result of rigDoUpload, if it is not FALSE you could start
an appropriate executable using shell() to process the data any further.

Ralf

William Jamieson
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 211
Joined: Fri Feb 01, 2013 1:31 am
Location: Palo Alto, CA put williamdjamieso into tEmail / put n@gmail.com after tEmail/ revmail tEmail
Contact:

Re: Can you send a message to your own controller?

Post by William Jamieson » Wed Nov 04, 2015 6:39 pm

It turns out I will not even need this because I was able to use jQuery to connect with my CDN provider directly. Would be a really cool trick of LiveCode to be able to create pseudo triggers on the fly through LC. One day.

Post Reply

Return to “CGIs and the Server”