Re: Time to Document Callbacks

David Nicol <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.dbi.sybase.devel
Message-ID <[email protected]>
On Tue, Oct 27, 2009 at 2:50 PM, David E. Wheeler <[email protected]> wrote:
>> Ideally I'd like to see an abstract interface for managing callbacks,
>> rather than the current "stuff it in a hash". That way future support
>> for post-method callbacks and multi-callbacks per method and handle
>> could be added without exposing (and locking us into) particular
>> implementation details.
>
> Do you have something in mind? What would it look like?

Trying to answer this for Tim, how about instead of

>>>   $sth->{PostCallbacks}{fetch} = sub {
>>>       my ($sth, $row) = @_;
>>>       $row->[3] = DateTime::Format::Pg->parse_datetime($row->[3]);
>>>   };

one would do

   $sth->AddPostCallback( fetch => sub {
       my ($sth, $row) = @_;
       $row->[3] = DateTime::Format::Pg->parse_datetime($row->[3]);
    });

dln

-- 
warlorded myself
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.