Loading ...
Sorry, an error occurred while loading the content.
 

Re: [soaplite] Destructors

Expand Messages
  • Paul Kulchenko
    Hi, Michael! Client doesn t have control on it. Depends on server configuration: 10 minutes of inactivity time by default, can be altered with custom handler.
    Message 1 of 4 , Apr 16, 2001
      Hi, Michael!

      Client doesn't have control on it. Depends on server configuration:
      10 minutes of inactivity time by default, can be altered with custom
      handler. You can provide function for garbage collection specific for
      class (or several classes):

      .......
      -> objects_by_reference(
      'My::PersistentIterator', 'My::SessionIterator'
      => \&garbage_collector)

      sub &garbage_collector {
      my(
      $number_of_objects_of_this_class, # if you want to implement
      cache
      $current_time,
      $object,
      $type, # ref $object
      $creation_time, # cannot be undef
      $last_access_time, # can be undef if not accessed
      ) = @_;
      .....
      1; # object will be collected
      0; # object will be kept
      }

      This is the default function:
      sub { $_[1]-$_[$_[5] ? 5 : 4] > 600 }
      check if access or creation time was more than 10 minutes ago.

      Still in infancy, but works.

      Best wishes, Paul.

      --- "Brutsch, Michael" <mbrutsch@...> wrote:
      > If you instantiate an object from the client, when does the
      > server-side
      > memory for that object get freed?
      >
      > ------------------------ Yahoo! Groups Sponsor
      >
      > To unsubscribe from this group, send an email to:
      > soaplite-unsubscribe@yahoogroups.com
      >
      >
      >
      > Your use of Yahoo! Groups is subject to
      > http://docs.yahoo.com/info/terms/
      >
      >


      __________________________________________________
      Do You Yahoo!?
      Get email at your own domain with Yahoo! Mail.
      http://personal.mail.yahoo.com/
    • fulkohew <fulkohew@yahoo.com>
      ... custom ... for ... cache ... I have tried ths example, i.e. - objects_by_reference( TestF = &garbage_collector) and in all permuatations, but my server
      Message 2 of 4 , Jan 23, 2003
        paulclinger@... wrote on Mon Apr 16, 2001:

        > Client doesn't have control on it. Depends on server
        configuration:
        > 10 minutes of inactivity time by default, can be altered with
        custom
        > handler. You can provide function for garbage collection specific
        for
        > class (or several classes):
        >
        > .......
        > -> objects_by_reference(
        > 'My::PersistentIterator',
        > 'My::SessionIterator'
        > => \&garbage_collector)
        >
        > sub &garbage_collector {
        > my(
        > $number_of_objects_of_this_class, # if you want to implement
        cache
        > $current_time,
        > $object,
        > $type, # ref $object
        > $creation_time, # cannot be undef
        > $last_access_time, # can be undef if not accessed
        > ) = @_;
        > .....
        > 1; # object will be collected
        > 0; # object will be kept
        > }

        I have tried ths example, i.e.

        -> objects_by_reference('TestF' => \&garbage_collector)

        and in all permuatations, but my server side gives the error:

        "Use of uninitialized value in hash slice at
        /usr/lib.../SOAP/Lite.pm line 1900."

        Which is in the 'objects_by_reference()' subroutine.

        Is this a bug? Can you help?

        TIA
        Fulko
      • Paul Kulchenko
        Hi Fulko, ... It appears to be my fault. The code inside objects_by_reference turns out to be version dependent (it relies on left-to-right order of execution
        Message 3 of 4 , Jan 23, 2003
          Hi Fulko,

          > "Use of uninitialized value in hash slice at
          > /usr/lib.../SOAP/Lite.pm line
          > 1900."
          >
          > Which is in the 'objects_by_reference()' subroutine.
          >
          > Is this a bug? Can you help?
          It appears to be my fault. The code inside objects_by_reference turns
          out to be version dependent (it relies on left-to-right order of
          execution which is not always true). I'll fix that. Thanks.

          Best wishes, Paul.

          --- Fulko.Hew@... wrote:
          >
          > paulclinger@... wrote on Mon Apr 16, 2001:
          >
          > > Client doesn't have control on it. Depends on server
          > configuration:
          > > 10 minutes of inactivity time by default, can be altered with
          > custom
          > > handler. You can provide function for garbage collection specific
          > for
          > > class (or several classes):
          > >
          > > .......
          > > -> objects_by_reference(
          > > 'My::PersistentIterator',
          > > 'My::SessionIterator'
          > > => \&garbage_collector)
          > >
          > > sub &garbage_collector {
          > > my(
          > > $number_of_objects_of_this_class, # if you want to implement
          > cache
          > > $current_time,
          > > $object,
          > > $type, # ref $object
          > > $creation_time, # cannot be undef
          > > $last_access_time, # can be undef if not accessed
          > > ) = @_;
          > > .....
          > > 1; # object will be collected
          > > 0; # object will be kept
          > > }
          >
          > I have tried ths example, i.e.
          >
          > -> objects_by_reference('TestF' => \&garbage_collector)
          >
          > and in all permuatations, but my server side gives the error:
          >
          > "Use of uninitialized value in hash slice at
          > /usr/lib.../SOAP/Lite.pm line
          > 1900."
          >
          > Which is in the 'objects_by_reference()' subroutine.
          >
          > Is this a bug? Can you help?
          >
          > TIA
          > Fulko
          >
          > ------------------------------------------------------------
          > Fulko Hew, Lead Designer - Management Tools
          > SITA, 777 Walkers Line, Burlington, Ontario, Canada, L7N 2G1
          > 905-681-5570
          > fulko.hew@...
          >


          __________________________________________________
          Do you Yahoo!?
          Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
          http://mailplus.yahoo.com
        Your message has been successfully submitted and would be delivered to recipients shortly.