turbolucene._SearcherFactory

Package turbolucene :: Class _SearcherFactory |
[hide private]
[frames] | no frames]

# Class _SearcherFactory

source code

Produces running _Searcher threads.

`PythonThread` threads can only be started by the main program or other `PythonThread` threads, so this `PythonThread`-based class creates and starts single-use _Searcher threads. This thread is created and started by the main program during TurboGears initialization as a singleton.

To get a _Searcher thread, call the _SearcherFactory instance. Then pass the query to the _Searcher thread that was returned.

Instance Methods | [hide private]
Inherited from `PyLucene.PythonThread`: `join`, `start` Inherited from `threading.Thread`: `__repr__`, `getName`, `isAlive`, `isDaemon`, `setDaemon`, `setName` Inherited from `threading.Thread` (private): `_set_daemon` Inherited from `threading._Verbose` (private): `_note` Inherited from `object`: `__delattr__`, `__getattribute__`, `__hash__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__setattr__`, `__str__`
Public API
__init__(self, *searcher_args, **searcher_kwargs) Initialize message queues and start the thread. | source code
_Searcher |
__call__(self) Send a request for a running _Searcher class, then return it. | source code
stop(self) Stop the _SearcherFactory thread. | source code
Threaded methods
run(self) Listen for requests and create _Searcher classes. | source code

Properties | [hide private]
Inherited from `object`: `__class__`

Method Details | [hide private]

### __init__(self, *searcher_args, **searcher_kwargs) (Constructor) | source code
Initialize message queues and start the thread. Overrides: PyLucene.PythonThread.__init__ Note: The thread is started as soon as the class is instantiated.

### __call__(self) (Call operator) | source code
Send a request for a running _Searcher class, then return it. Returns: _Searcher A running instance of the _Searcher class.

### run(self) | source code
Listen for requests and create _Searcher classes. If the request message is `stop`, then the thread will be shutdown. Overrides: threading.Thread.run Note: This method is run in the thread.