logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

KiokuDB::Set - Set::Object wrapper for KiokuDB with lazy loading.

Author

       Yuval Kogman <nothingmuch@woobling.org>

Description

       This role defines the API implemented by KiokuDB::Set::Transient, KiokuDB::Set::Deferred, and
       KiokuDB::Set::Loaded.

       These three classes are modeled after Set::Object, but have implementation details specific to KiokuDB.

   TransientSets
       Transient sets are in memory, they are sets that have been constructed by the user for subsequent
       insertion into storage.

       When you create a new set, this is what you should use.

       KiokuDB::Util provides convenience functions ("set" in KiokuDB::Util and "weak_set" in KiokuDB::Util) to
       construct transient sets concisely.

   DeferredSets
       When a set is loaded from the backend, it is deferred by default. This means that the objects inside the
       set are not yet loaded, and will be fetched only as needed.

       When set members are needed, the set is upgraded in place into a KiokuDB::Set::Loaded object.

   LoadedSets
       This is the result of vivifying the members of a deferred set, and is similar to transient sets in
       implementation.

Name

       KiokuDB::Set - Set::Object wrapper for KiokuDB with lazy loading.

Synopsis

           use KiokuDB::Util qw(set);

           my $set = set(); # KiokuDB::Set::Transient

           $set->insert($object);

           warn $set->size;

           my $id = $dir->store( $set );

Version

       version 0.57

See Also