[perl5-dbi/dbi] c3d7a1: Fix disappearing $_ inside callbacks.

2017-06-01 Thread Tim Bunce
y 2017) Changed paths: M DBI.xs M t/70callbacks.t Log Message: --- Fix disappearing $_ inside callbacks. Commit: 515c66ef53154bfa4e745ed986c428b5d68b314e https://github.com/perl5-dbi/dbi/commit/515c66ef53154bfa4e745ed986c428b5d68b314e Author: Tim Bunce &

[perl5-dbi/dbi] 176ffe: Callbacks ought not to be passed inline to connect...

2013-10-11 Thread H.Merijn Brand - Tux
, 03 Sep 2013) Changed paths: M DBI.pm Log Message: --- Callbacks ought not to be passed inline to connect_cached. So mention that fact in the callbacks documentation. Commit: dbadce943a501a39668b58eb52227c23851690bf https://github.com/perl5-dbi/dbi/commit

[perl5-dbi/dbi] 176ffe: Callbacks ought not to be passed inline to connect...

2013-09-04 Thread Tim Bunce
) Changed paths: M DBI.pm Log Message: --- Callbacks ought not to be passed inline to connect_cached. So mention that fact in the callbacks documentation. Commit: d157cf06670f9e65a5340c86aae33c087bc8a793 https://github.com/perl5-dbi/dbi/commit

Re: Time to Document Callbacks

2010-03-08 Thread Martin Evans
Tim Bunce wrote: On Sun, Mar 07, 2010 at 10:29:29AM -0800, David E. Wheeler wrote: On Mar 7, 2010, at 5:43 AM, Tim Bunce wrote: Looks good, thanks. Pity you removed the `$dbh-{private_myapp_sql_mode}` bit, though, as that's required when using Cconnect_cached(), which you almost certainly

Re: Time to Document Callbacks

2010-03-07 Thread Tim Bunce
On Sat, Mar 06, 2010 at 04:07:09PM -0800, David E. Wheeler wrote: On Mar 6, 2010, at 3:45 PM, Tim Bunce wrote: I was tempted to leave The cool thing is but opted to drop it as it doesn't match the tone of the rest of the docs - although they are rather dry :) Pity. Thought I was

Re: Time to Document Callbacks

2010-03-07 Thread David E. Wheeler
On Mar 7, 2010, at 5:43 AM, Tim Bunce wrote: Looks good, thanks. Pity you removed the `$dbh-{private_myapp_sql_mode}` bit, though, as that's required when using Cconnect_cached(), which you almost certainly are doing if you need this hack. Are you sure it's required when using connected()?

Re: Time to Document Callbacks

2010-03-07 Thread Tim Bunce
On Sun, Mar 07, 2010 at 10:29:29AM -0800, David E. Wheeler wrote: On Mar 7, 2010, at 5:43 AM, Tim Bunce wrote: Looks good, thanks. Pity you removed the `$dbh-{private_myapp_sql_mode}` bit, though, as that's required when using Cconnect_cached(), which you almost certainly are doing if you

Re: Time to Document Callbacks

2010-03-07 Thread David E. Wheeler
On Mar 7, 2010, at 3:27 PM, Tim Bunce wrote: Uh, yeah, I just looked at the code. Sometimes I confuse myself. I think that's a bug. I always intended connected() to be used as an on-new-physical-connection-established hook. Any objections to making it so? Not from me, but you might get

Re: Time to Document Callbacks

2010-03-06 Thread Tim Bunce
On Tue, Mar 02, 2010 at 05:08:21PM -0800, David E. Wheeler wrote: Howdy, I've just committed r13835, which documents Callbacks. Yay! A few notes: Great. Thanks! * Tim, you earlier said: I could arrange for Callbacks to only apply to methods called by the applicationi

Re: Time to Document Callbacks

2010-03-06 Thread David E. Wheeler
On Mar 6, 2010, at 3:45 PM, Tim Bunce wrote: I was tempted to leave The cool thing is but opted to drop it as it doesn't match the tone of the rest of the docs - although they are rather dry :) Pity. Thought I was starting to change that. ;-P I've made assorted edits and added some extra

Re: Time to Document Callbacks

2010-03-02 Thread David E. Wheeler
Howdy, I've just committed r13835, which documents Callbacks. Yay! A few notes: * Tim, you earlier said: I could arrange for Callbacks to only apply to methods called by the applicationi, and not to 'nested calls'. That's a fairly major change after this length of time but given the limited

Re: Time to Document Callbacks

2009-10-30 Thread Tim Bunce
On Thu, Oct 29, 2009 at 05:10:07PM -0700, David E. Wheeler wrote: On Oct 29, 2009, at 4:24 PM, Tim Bunce wrote: I could arrange for Callbacks to only apply to methods called by the applicationi, and not to 'nested calls'. That's a fairly major change after this length of time but given

Re: Time to Document Callbacks

2009-10-28 Thread Tim Bunce
On Tue, Oct 27, 2009 at 06:07:46PM -0700, David E. Wheeler wrote: On Oct 27, 2009, at 3:24 PM, Tim Bunce wrote: The simplest thing that could possibly work is probably: $dbh-{Callbacks} = { method_foo = sub { ... }, method_bar = sub { ... }, ChildCallbacks

Re: Time to Document Callbacks

2009-10-28 Thread David E. Wheeler
of making that change. I'd happily support someone else doing the leg work though. Out of my league. I'm starting to fail to see the point of callbacks aside from connect(). :-( I'm probably being over-cautious. Most drivers use fetch() or fetchrow_arrayref() as the lowest-level calling method

Re: Time to Document Callbacks

2009-10-28 Thread David E. Wheeler
On Oct 28, 2009, at 10:26 AM, David E. Wheeler wrote: Here's a deal: you write some tests for ChildCallbacks in t/70callbacks.t and I'll implement them. Deal. Done in r13445. Best, David

Re: Time to Document Callbacks

2009-10-27 Thread Tim Bunce
getting passed on to the statement handle. So I guess the Callbacks attribute is not passed on to statement handles created for the database handle? Yeap. Seems a shame… I recall thinking about it but opting not to. I can't recall why though. Possibly just to err on the side of caution

Re: Time to Document Callbacks

2009-10-26 Thread Tim Bunce
On Sun, Oct 25, 2009 at 10:24:57PM -0700, David E. Wheeler wrote: On Oct 24, 2009, at 2:50 PM, Tim Bunce wrote: Callbacks are handled by the method dispatcher so all method names are valid (so don't bother trying to list them in the docs :) Plus the two special cases for connect_cached

Re: Time to Document Callbacks

2009-10-25 Thread David E. Wheeler
On Oct 24, 2009, at 2:50 PM, Tim Bunce wrote: Callbacks are handled by the method dispatcher so all method names are valid (so don't bother trying to list them in the docs :) Plus the two special cases for connect_cached: 'connect_cached.new' and 'connect_cached.reused'. (There's also

Re: Time to Document Callbacks

2009-10-25 Thread David E . Wheeler
the Callbacks attribute is not passed on to statement handles created for the database handle? Seems a shame… One other thing: It's nice that the callbacks execute before the method call, so that you can disable it by undefing $_. But it'd be equally handle to have callbacks after the method call

Re: Time to Document Callbacks

2009-10-24 Thread Tim Bunce
On Sat, Oct 24, 2009 at 08:45:42AM -0700, David E. Wheeler wrote: Tim, I think it's high time we documented callbacks. I'm pretty sure the DBIx::Class folks are going to want to make use of them shortly. I'd be happy to contribute the docs. Great! Is there a way to get a list of all

Callbacks - in need of docs

2006-02-13 Thread Tim Bunce
I've just noticed that the Callbacks attribute doesn't have any documentation. Any volunteers? Tim.

a callbacks implementation idea

2005-11-03 Thread David Nicol
'connect.cached.new' = [\pre, \post] syntax so that I could do If I understand correctly, the QPSMTPD people have just implemented self-registering callbacks in modules by standardizing the names of the callbacks and letting package introspection find them all. The names are hook_* where

Re: Status of Callbacks

2005-11-03 Thread Tim Bunce
On Wed, Nov 02, 2005 at 03:34:14PM -0800, David Wheeler wrote: On Nov 2, 2005, at 2:59 PM, Tim Bunce wrote: I've an assortments of changes to checkin prior to the next release, but docs for Callbacks isn't part of them. Patches most welcome. Okay. I've been rather busy for a while[1

Re: a callbacks implementation idea

2005-11-03 Thread Tim Bunce
Are you volunteering? Tim. On Thu, Nov 03, 2005 at 01:24:21PM -0600, David Nicol wrote: 'connect.cached.new' = [\pre, \post] syntax so that I could do If I understand correctly, the QPSMTPD people have just implemented self-registering callbacks in modules by standardizing the names

Re: Status of Callbacks

2005-11-03 Thread David Wheeler
On Nov 3, 2005, at 2:13 PM, Tim Bunce wrote: Because the aggregates don't persist, I need to create them for every database handle. Since I run persistent apps (with mod_perl), it's best for me to do it the first time I connect to the database. Since I use connect_cached(), It's hard to know

Re: a callbacks implementation idea

2005-11-03 Thread David Nicol
I am _so_ busy. package CBI::callbacks; sub import{ my $caller = caller(); while(my($name,$thingy) = each %{${caller}::}){ $name =~ /hook_(.+)/ or next; ... }; }; On 11/3/05, Tim Bunce [EMAIL PROTECTED] wrote: Are you volunteering? Tim. On Thu, Nov 03, 2005

Re: Status of Callbacks

2005-11-02 Thread David Nicol
On 11/1/05, Dean Arnold [EMAIL PROTECTED] wrote: Er, care to refresh our collective memories w/ the executive overview of what callbacks is ? It may amuse: I was once doing telecommuting mod_perl development and was tasked with get the callbacks working -- they were talking about their CRM.

Re: Status of Callbacks

2005-11-02 Thread Tim Bunce
On Tue, Nov 01, 2005 at 05:55:31PM -0800, Dean Arnold wrote: David Wheeler wrote: On Nov 1, 2005, at 12:11 PM, David Wheeler wrote: So, what's the status on Callbacks? Are they ready to go into a release? Yes. See http://svn.perl.org/modules/dbi/trunk/t/70callbacks.t Ah, I see from

Re: Status of Callbacks

2005-11-02 Thread David Wheeler
On Nov 2, 2005, at 2:59 PM, Tim Bunce wrote: I've an assortments of changes to checkin prior to the next release, but docs for Callbacks isn't part of them. Patches most welcome. Okay. I've been rather busy for a while[1] and that won't get much better in the short term. Help would

Status of Callbacks

2005-11-01 Thread David Wheeler
Hi All, I just noticed that, while the Callbacks attribute has been implemented in SVN, it still hasn't made it into a release. I could have sworn that it was a long time ago that I worked on them. And didn't I write some docs for them? So, what's the status on Callbacks? Are they ready

Re: Status of Callbacks

2005-11-01 Thread Dean Arnold
David Wheeler wrote: Hi All, I just noticed that, while the Callbacks attribute has been implemented in SVN, it still hasn't made it into a release. I could have sworn that it was a long time ago that I worked on them. And didn't I write some docs for them? So, what's the status

Re: Status of Callbacks

2005-11-01 Thread David Wheeler
On Nov 1, 2005, at 12:19 PM, Dean Arnold wrote: Er, care to refresh our collective memories w/ the executive overview of what callbacks is ? My DBI inbox doesn't surface anything, and Google ain't much help either...I see a blurb in the CPAN roadmap doc, but thats it. See the thread starting

Re: Status of Callbacks

2005-11-01 Thread David Wheeler
On Nov 1, 2005, at 12:11 PM, David Wheeler wrote: So, what's the status on Callbacks? Are they ready to go into a release? Ah, I see from this post: http://www.mail-archive.com/dbi-dev@perl.org/msg03793.html That Steven Schubiger was going to pen some docs for Callbacks. Since

Re: Status of Callbacks

2005-11-01 Thread Dean Arnold
David Wheeler wrote: On Nov 1, 2005, at 12:11 PM, David Wheeler wrote: So, what's the status on Callbacks? Are they ready to go into a release? Ah, I see from this post: http://www.mail-archive.com/dbi-dev@perl.org/msg03793.html That Steven Schubiger was going to pen some docs

Re: Status of Callbacks

2005-11-01 Thread David Wheeler
On Nov 1, 2005, at 5:55 PM, Dean Arnold wrote: Any chance these would work in Pg's PL/perl, extproc_perl, or the (whatever MySQL does) ? No, the callbacks are just Perl code refs that get called before a method gets executed. See t/70callbacks.t in SVN. Best, David

Re: Callbacks

2005-02-12 Thread Tim Bunce
On Fri, Feb 11, 2005 at 11:18:34AM -0800, David Wheeler wrote: On Feb 4, 2005, at 10:38 AM, David Wheeler wrote: That's starting to get might complex, isn't it? Uh, mite. :-) Or mighty, perhaps. Tim.

Re: Callbacks

2005-02-11 Thread David Wheeler
On Feb 4, 2005, at 10:38 AM, David Wheeler wrote: That's starting to get might complex, isn't it? Uh, mite. :-) D smime.p7s Description: S/MIME cryptographic signature

Callbacks

2005-02-04 Thread Tim Bunce
On Thu, Feb 03, 2005 at 03:49:11PM -0800, David Wheeler wrote: On Feb 3, 2005, at 3:30 PM, Tim Bunce wrote: Should be pretty straight-forward. Are there other events for which you'd like to add callbacks? OnPrepare, perhaps? OnExecute? OnFetch? Yes, but let's just start with the connect

Re: Callbacks

2005-02-04 Thread David Wheeler
On Feb 4, 2005, at 2:08 AM, Tim Bunce wrote: One way I'd had in the back of my mind way to use the DBI dispatcher to fire the callbacks. $h-{Callbacks}-{$method_name} = \foo; # called on entry $h-{Callbacks}-{$method_name} = [ \foo, \bar ]; # foo on entry, bar on exit $h-{Callbacks