Package amplee :: Package indexer :: Class Indexer
[show private | hide private]
[frames | no frames]

Type Indexer

object --+
         |
        Indexer


Method Summary
  __init__(self, batch)
This class is the manager of your index handlers.
  apply_all(self)
Unqueue up to `self.batch` number of members from the global queue and apply all the index handlers.
  process(self, member)
Indexes the provided member
  register(self, index)
Registers a new index handler.
  retrieve(self, name)
Returns the index handler per its name
  shutdown(self)
Shutdown all the associated index container
  start_daemon(self, interval)
Convenient way to start a daemon timer that will process the queue of indexable members.
  stop_daemon(self)
Stops the daemon timer
  to_dict(self, result)
Returns teh given Set as a dictionnary of the form:
  unregister(self, index)
Removes an index handler
    Inherited from object
  __delattr__(...)
x.__delattr__('name') <==> del x.name
  __getattribute__(...)
x.__getattribute__('name') <==> x.name
  __hash__(x)
x.__hash__() <==> hash(x)
  __new__(T, S, ...)
T.__new__(S, ...) -> a new object with type S, a subtype of T
  __reduce__(...)
helper for pickle
  __reduce_ex__(...)
helper for pickle
  __repr__(x)
x.__repr__() <==> repr(x)
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value
  __str__(x)
x.__str__() <==> str(x)

Method Details

__init__(self, batch=5)
(Constructor)

This class is the manager of your index handlers. You register your index handlers and then you start the indexer daemon which will run at regular interval, polling from the global queue members to index.

If you have your own even mechanism you don't need to start the daemon and can simply call `apply_all` to perform the same job at will.

The ``batch`` parameter indicates how many members to dequeue during one iteration of indexing.
Overrides:
__builtin__.object.__init__

apply_all(self)

Unqueue up to `self.batch` number of members from the global queue and apply all the index handlers.

A handler only needs to be a class that implements a method named `update` and taking the `member` as its unique parameter.

process(self, member)

Indexes the provided member

register(self, index)

Registers a new index handler.

retrieve(self, name)

Returns the index handler per its name

shutdown(self)

Shutdown all the associated index container

start_daemon(self, interval=60.0)

Convenient way to start a daemon timer that will process the queue of indexable members.

Note that if you try to start it before it was stopped an error will be raised.

stop_daemon(self)

Stops the daemon timer

to_dict(self, result)

Returns teh given Set as a dictionnary of the form:

{collection_name: [member_ids]}

unregister(self, index)

Removes an index handler

Generated by Epydoc 2.1 on Thu Jul 19 15:32:16 2007 http://epydoc.sf.net