furemcape.feeder package

Feeds log data to transformers.

Submodules

furemcape.feeder.socket module

Socket feeder.

class furemcape.feeder.socket.SocketFactory(transformer, socket, app, encoding='utf-8')

Bases: twisted.internet.protocol.ServerFactory

Twisted factory for socket feeder.

buildProtocol(addr)

Creates a new SocketProtocol instance.

Parameters

addr – Address (unused).

Returns

New socket protocol instance.

Return type

SocketProtocol

class furemcape.feeder.socket.SocketListenerService(socket='', app='', encoding='', transformer=None, reactor=None)

Bases: twisted.application.service.Service

Twisted service for socket feeder.

startService()

Starts the service.

stopService()

Stops the service.

class furemcape.feeder.socket.SocketProtocol(transformer, source, encoding='utf-8')

Bases: twisted.protocols.basic.LineOnlyReceiver

Twisted protocol for socket feeder.

delimiter = b'\n'
lineReceived(line)

Receives a line and feeds it to the transformer.

Parameters

line (str) – Received line.

furemcape.feeder.stdio module

Standard I/O feeder.

class furemcape.feeder.stdio.StdioProtocol(service)

Bases: twisted.protocols.basic.LineOnlyReceiver

Twisted protocol for stdio feeder.

connectionLost(reason)

Receives an EOF and shuts down twisted.

Parameters

reason – Metadata about why the connection was lost.

delimiter = b'\n'
lineReceived(line)

Receives a line and feeds it to the transformer.

Parameters

line (str) – Received line.

class furemcape.feeder.stdio.StdioService(app='stdio', transformer=None, reactor=None)

Bases: twisted.application.service.Service

Twisted service for socket feeder.

startService()

Starts the service.

stopService()

Stops the service.