From last friday, I have started implementing conditional queue
subscription, that allows clients subscribe to rows with certain
conditions.
For example, if a query like
select queue_wait('tbl:v<3');
is executed, Q4M will only return rows with column v less than 3. In
the next release, only integer columns will be supported in the
condition expression.
If you have any ideas or suggestions, please let me know.
--
Kazuho Oku
> I haven't thought this through yet so it might be a can of worms, but
> would it be possible to bind parameters from perl?
>
> $sth = $dbh->prepare("select queue_wait('tbl:v<?')");
> $sth->execute(3);
I am not sure how the placeholders of DBI::mysql work, but at least
the script below should work fine.
$sth = $dbh->prepare("select queue_wait('?')");
$sth->execute(sprintf 'tbl:v<%d', 3);
> --d
>
>
> On Mar 24, 5:29 pm, "Kazuho Oku" <kazuho...@gmail.com> wrote:
> > Hi all,
> >
> > From last friday, I have started implementing conditional queue
> > subscription, that allows clients subscribe to rows with certain
> > conditions.
> >
> > For example, if a query like
> >
> > select queue_wait('tbl:v<3');
> >
> > is executed, Q4M will only return rows with column v less than 3. In
> > the next release, only integer columns will be supported in the
> > condition expression.
> >
> > If you have any ideas or suggestions, please let me know.
> >
> > --
> > Kazuho Oku
>
> >
>
--
Kazuho Oku
The parser of conditions is written using boost::spirit, so you can
find out the BNF-like grammar in queue_cond.cc. Most of the operators
of SQL are supported.
http://kazuho.31tools.com/svn/q4m/trunk/src/queue_cond.cc
The code has not been optimized yet, so a table scan occurs every time
a row is inserted to a Q4M table. However (I hope) it should work
fine for testing and development purposes.
2008/3/24, Kazuho Oku <kazu...@gmail.com>:
--
Kazuho Oku