[APE Project] APE engine Mysql push data to channel on insert

270 views
Skip to first unread message

falex...@gmail.com

unread,
May 12, 2010, 4:02:09 PM5/12/10
to APE Project
Hello,

i am working with APE Engine (http://www.ape-project.org) and up until
now i had no actual problem.

The problem is that i would like to use the MySQL module and push data
to a channel each time a row is inserted into a table.

I've tried to setup a server side module, i created an SQL query but
data is fetched only when the server boots.

How can i make this work?

I've searched the entire discussion group and the docs but didn't find
such a thing. Only someone that just said "It's possible"

--
You received this message because you are subscribed to the Google
Groups "APE Project" group.
To post to this group, send email to ape-p...@googlegroups.com
To unsubscribe from this group, send email to
ape-project...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/ape-project?hl=en
---
APE Project (Ajax Push Engine)
Official website : http://www.ape-project.org/
Git Hub : http://github.com/APE-Project/

falex...@gmail.com

unread,
May 17, 2010, 1:53:26 PM5/17/10
to APE Project
Anyone? Please? At least a hint? :)

Manas B

unread,
May 17, 2010, 2:04:52 PM5/17/10
to APE Project
Hi there,
As i understand you are trying to push data to Ape Server when data is
inserted into mysql. Please make note APE is a event driven server.
Either there are system events or you create events by command. In the
instant case your event is generated at mysql side which APE server
has no method of knowing unless you run a process (module) on APE
server which will search for records in mysql. If it find record it
will pick and then broad cast on the channel.
A theoritical example would be

function() {
sql.query('SELECT new_record FROM data WHERE ape_pickup = 0',
function(res, errorNo) {
if(res) {
Broadcast on Channel
sql.query('UPDATE data set ape_pickup =1
}
}.bind(this));
}).periodical(1000*60*2);

On May 13, 1:02 am, "falexand...@gmail.com" <falexand...@gmail.com>
wrote:
> Hello,
>
> i am working with APE Engine (http://www.ape-project.org) and up until
> now i had no actual problem.
>
> The problem is that i would like to use the MySQL module and push data
> to a channel each time a row is inserted into a table.
>
> I've tried to setup a server side module, i created an SQL query but
> data is fetched only when the server boots.
>
> How can i make this work?
>
> I've searched the entire discussion group and the docs but didn't find
> such a thing. Only someone that just said "It's possible"
>
> --
> You received this message because you are subscribed to the Google
> Groups "APE Project" group.
> To post to this group, send email to ape-p...@googlegroups.com
> To unsubscribe from this group, send email to
> ape-project...@googlegroups.com
> For more options, visit this group athttp://groups.google.com/group/ape-project?hl=en

falex...@gmail.com

unread,
May 17, 2010, 2:23:56 PM5/17/10
to APE Project
Hi again and thnx for your time to reply.

So i guess this is not really possible. ( But ain't it a great
idea? :D )

Thanx again for your time.

Nicolas Trani

unread,
May 17, 2010, 6:16:51 PM5/17/10
to ape-p...@googlegroups.com
Hi,

if your data are added to MySQL with PHP (or any other language) you can
push change to APE Server with inlinepush.

Check the controller demo for more informations :
http://github.com/APE-Project/APE_JSF/tree/master/Demos/Controller

Cheers.

falex...@gmail.com a écrit :

Ziga Ham

unread,
May 17, 2010, 6:23:27 PM5/17/10
to ape-p...@googlegroups.com
You could also make MySQL trigger...
in mysql triggers can call external applications trough UDF.
--
Best regards,
Žiga Ham

falex...@gmail.com

unread,
May 17, 2010, 6:32:50 PM5/17/10
to APE Project
Thnx for the great answers. I'll try setting up a trigger that fires
up an inline push with PHP (That should be tricky..)

Since we've brought the inline push thing up, I've set up a lib that
uses inline push by calling
echo file_get_contents($ape_url.. bla bla)

is it possible to call the echo 2 or more times or will it mess the
jsons that are returned?

PS. I'm greek so, sorry for my English if this is all greek to you :D

On May 18, 1:23 am, Ziga Ham <ziga....@gmail.com> wrote:
> You could also make MySQL trigger...
> in mysql triggers can call external applications trough UDF.
>
>
>
>
>
> On Tue, May 18, 2010 at 12:16 AM, Nicolas Trani <n.tr...@weelya.com> wrote:
> > Hi,
>
> > if your data are added to MySQL with PHP (or any other language) you can
> > push change to APE Server with inlinepush.
>
> > Check the controller demo for more informations :
> >http://github.com/APE-Project/APE_JSF/tree/master/Demos/Controller
>
> > Cheers.
>
> > falexand...@gmail.com a écrit :
> >>>> ape-project...@googlegroups.com<ape-project%2Bunsubscribe@googlegr oups.com>
> >>>> For more options, visit this group athttp://
> >>>> groups.google.com/group/ape-project?hl=en
> >>>> ---
> >>>> APE Project (Ajax Push Engine)
> >>>> Official website :http://www.ape-project.org/
> >>>> Git Hub :http://github.com/APE-Project/
>
> >>> --
> >>> You received this message because you are subscribed to the Google
> >>> Groups "APE Project" group.
> >>> To post to this group, send email to ape-p...@googlegroups.com
> >>> To unsubscribe from this group, send email to
> >>> ape-project...@googlegroups.com<ape-project%2Bunsubscribe@googlegr oups.com>
> >>> For more options, visit this group athttp://
> >>> groups.google.com/group/ape-project?hl=en
> >>> ---
> >>> APE Project (Ajax Push Engine)
> >>> Official website :http://www.ape-project.org/
> >>> Git Hub :http://github.com/APE-Project/
>
> > --
> > You received this message because you are subscribed to the Google
> > Groups "APE Project" group.
> > To post to this group, send email to ape-p...@googlegroups.com
> > To unsubscribe from this group, send email to
> > ape-project...@googlegroups.com<ape-project%2Bunsubscribe@googlegr oups.com>
Reply all
Reply to author
Forward
0 new messages