workers Package

base Module

class thriftworker.workers.base.BaseWorker(pool_size=None)[source]

Bases: thriftworker.utils.mixin.StartStopMixin, abc.NewBase

class Request(loop, connection, message_buffer, request_id, service)

Bases: object

Describe a request.

connection
dispatch()

Notify connection that request was processed.

dispatch_time
dispatching_timers
end_time
exception
execute(processor)

Process our request.

execution_time
loop
message_buffer
method
method_name
receipt_time
request_id
response
service
start_time
successful
BaseWorker.concurrency[source]

How many tasks executed in parallel?

BaseWorker.create_callback()[source]

Create callback that should be called after request was done.

BaseWorker.create_consumer()[source]
BaseWorker.create_producer(service)[source]

Create producer for connections.

BaseWorker.create_task(processor)[source]

Create new task for given processor.

class thriftworker.workers.base.Request(loop, connection, message_buffer, request_id, service)[source]

Bases: object

Describe a request.

connection
dispatch()[source]

Notify connection that request was processed.

dispatch_time
dispatching_timers[source]
end_time
exception
execute(processor)[source]

Process our request.

execution_time[source]
loop
message_buffer
method
method_name[source]
receipt_time
request_id
response
service
start_time
successful

green Module

sync Module

class thriftworker.workers.sync.Promise(func, callback)[source]

Bases: object

Used to enqueue task execution in thread pool.

callback
cb(*args)[source]
exception
func
result
class thriftworker.workers.sync.SyncWorker(pool_size=None)[source]

Bases: thriftworker.workers.base.BaseWorker

Process all request in separate thread.

create_consumer()[source]

threads Module

class thriftworker.workers.threads.Pool(app, size=None)[source]

Bases: object

Orchestrate workers. Start and stop them, provide new tasks.

class Worker(app, queue, shutdown_timeout=None)

Bases: threading.Thread

Simple threaded worker.

body()

Consume messages from queue and execute them until empty message sent.

run()
wait()
Pool.put(task)[source]
Pool.start()[source]
Pool.stop()[source]
class thriftworker.workers.threads.ThreadsWorker(pool_size=None)[source]

Bases: thriftworker.workers.base.BaseWorker

Process all request in thread-pool.

class Message

Bases: tuple

Message(task, callback)

callback

Alias for field number 1

task

Alias for field number 0

ThreadsWorker.create_consumer()[source]
ThreadsWorker.start()[source]
ThreadsWorker.stop()[source]
class thriftworker.workers.threads.Worker(app, queue, shutdown_timeout=None)[source]

Bases: threading.Thread

Simple threaded worker.

body()[source]

Consume messages from queue and execute them until empty message sent.

run()[source]
wait()[source]
Read the Docs v: latest
Versions
latest
Downloads
PDF
HTML
Epub
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.