Package flumotion :: Package component :: Package misc :: Package httpserver :: Package httpcached :: Module strategy_base :: Class RemoteProducer
[hide private]

Class RemoteProducer

source code

             object --+    
                      |    
  common.StreamConsumer --+
                          |
extern.log.log.Loggable --+
                          |
                         RemoteProducer

Offers a IPushProducer interface to a caching session. It starts producing data from the specified point.

If the data is already cached by the session, it produce data with a reactor loop reading the data from the session by block.

If the data is not yet cached, it starts a request using the request manager and pipeline the data to the specified consumer.

It can recover request failures up to MAX_RESUME_COUNT times.

It's not used yet in the context of http-server. Until now, the simulations show that using a producer with long-lived HTTP requests instead of short lived block request is less efficient and produce bigger latency for the clients. At least when used with HTTP proxies.

Instance Methods [hide private]
 
__init__(self, consumer, session, offset, stats)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
resumeProducing(self) source code
 
pauseProducing(self) source code
 
stopProducing(self) source code
 
serverError(self, getter, code, message) source code
 
conditionFail(self, getter, code, message) source code
 
streamNotAvailable(self, getter, code, message) source code
 
onData(self, getter, data) source code
 
streamDone(self, getter) source code
 
_produce(self) source code
 
_write(self, data) source code
 
_stop(self) source code
 
_pipeline(self) source code
 
_terminate(self) source code

Inherited from common.StreamConsumer: onInfo

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Inherited from extern.log.log.Loggable: __providedBy__, __provides__, debug, doLog, error, info, log, logFunction, logObjectName, warning, warningFailure, writeMarker

Class Variables [hide private]
  logCategory = 'pipe-producer'
Implementors can provide a category to log their messages under.

Inherited from extern.log.log.Loggable: __implemented__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, consumer, session, offset, stats)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

serverError(self, getter, code, message)

source code 
Overrides: common.StreamConsumer.serverError

conditionFail(self, getter, code, message)

source code 
Overrides: common.StreamConsumer.conditionFail

streamNotAvailable(self, getter, code, message)

source code 
Overrides: common.StreamConsumer.streamNotAvailable

onData(self, getter, data)

source code 
Overrides: common.StreamConsumer.onData

streamDone(self, getter)

source code 
Overrides: common.StreamConsumer.streamDone