SEARCH
NEW RPMS
DIRECTORIES
ABOUT
FAQ
VARIOUS
BLOG

 
 

python-pyf-station rpm build for : OpenSuSE 13.X. For other distributions click python-pyf-station.

Name : python-pyf-station
Version : 2.0.4 Vendor : obs://build_opensuse_org/home:appleonkel
Release : 1.2 Date : 2016-10-10 14:34:12
Group : Development/Languages/Python Source RPM : python-pyf-station-2.0.4-1.2.src.rpm
Size : 0.04 MB
Packager : (none)
Summary : PyF.Station is a protocol with client and server implementation to transfer python generators accross tcp networks
Description :
Introduction
============

PyF.Station is a protocol with client and server to transfer python generators accross tcp networks. Items in the generator must be pyf.transport.Packet instances.

Best practice is to provide information about the flow in the first packet, identified as an header (containing for example authentication data, method, target, and so on).

Errors are passed on both ends.

Server
------

Please note that the server requires tgscheduler (to spawn tasks, passing generators) and twisted.

An example::

from twisted.internet import reactor
from pyf.station import FlowServer

def sample_handler(flow, client=None):
header = flow.next()
print header
for i, item in enumerate(flow):
if not i%50:
print i, item
print \"end of flow...\"
client.success(\"Done\")

factory = FlowServer(sample_handler)
reactor.listenTCP(8000,factory)
reactor.run()

The handler can be a simple callable, as in the example above, or a user defined class:

from twisted.internet import reactor
from pyf.station import FlowServer

class SampleHandler(object):

def __init__(self, flow, client):

self.flow = flow
self.client = client

def handle_data(self):

header = self.flow.next()
print header
for i, item in enumerate(self.flow):
if not i%50:
print i, item
print \"end of flow...\"
self.client.success(\"Done\")

factory = FlowServer(SampleHandler)
reactor.listenTCP(8000,factory)
reactor.run()

Another example, if you are in an already threaded env (like a wsgi server)::

from tgscheduler import scheduler
from twisted.internet import reactor
from pyf.station import FlowServer
from pyf.transport import Packet

def sample_handler(flow, client=None):
header = flow.next()
print header

for i, item in enumerate(flow):

if not i%50:
print i, item

client.message(Packet({\'type\': \'info\',
\'message\': \'hello ! (%s)\' % i}))

print \"end of flow...\"
client.success(\"Done\")

factory = FlowServer(sample_handler)
reactor.listenTCP(8000,factory)
scheduler.add_single_task(reactor.run,
kw=dict(installSignalHandlers=0),
initialdelay=0)


scheduler.start_scheduler()
while True:
pass

Client
------

Example of client::

from pyf.station import StationClient
from pyf.transport import Packet

client = StationClient(\'127.0.0.1\', 8000, True)

def message_handler(message_packet):

print \"Message handler triggered: %s\" % message_packet


client.add_listener(\'message_received\', message_handler)


flow = (Packet(dict(Field1=i+1,
Field2=(\'titi\', \'tata\')[i%2], num=i+1,
Field3=(i+1)*10))
for i in range(10000))

values = client.call(
flow,
header=dict(authtkt=\'my false auth token :)\',
action=\'my_action\'))

for i, value in enumerate(values):
if not i % 5000:
print i

if isinstance(value, Packet):
print value

RPM found in directory: /packages/linux-pbone/ftp5.gwdg.de/pub/opensuse/repositories/home:/appleonkel:/python/openSUSE_13.2/noarch

Content of RPM  Changelog  Provides Requires

Hmm ... It's impossible ;-) This RPM doesn't exist on any FTP server

Provides :
python-pyf-station

Requires :
python-setuptools
python-pyf-transport => 2.0
rpmlib(CompressedFileNames) <= 3.0.4-1
python-simplejson
rpmlib(PayloadFilesHavePrefix) <= 4.0-1
python-twisted
python-pyjon-events
python(abi) = 2.7
rpmlib(PayloadIsLzma) <= 4.4.6-1


Content of RPM :
/usr/lib/python2.7/site-packages/pyf
/usr/lib/python2.7/site-packages/pyf.station-2.0.4-py2.7-nspkg.pth
/usr/lib/python2.7/site-packages/pyf.station-2.0.4-py2.7.egg-info
/usr/lib/python2.7/site-packages/pyf.station-2.0.4-py2.7.egg-info/PKG-INFO
/usr/lib/python2.7/site-packages/pyf.station-2.0.4-py2.7.egg-info/SOURCES.txt
/usr/lib/python2.7/site-packages/pyf.station-2.0.4-py2.7.egg-info/dependency_links.txt
/usr/lib/python2.7/site-packages/pyf.station-2.0.4-py2.7.egg-info/entry_points.txt
/usr/lib/python2.7/site-packages/pyf.station-2.0.4-py2.7.egg-info/namespace_packages.txt
/usr/lib/python2.7/site-packages/pyf.station-2.0.4-py2.7.egg-info/not-zip-safe
/usr/lib/python2.7/site-packages/pyf.station-2.0.4-py2.7.egg-info/requires.txt
/usr/lib/python2.7/site-packages/pyf.station-2.0.4-py2.7.egg-info/top_level.txt
/usr/lib/python2.7/site-packages/pyf/station
/usr/lib/python2.7/site-packages/pyf/station/__init__.py
/usr/lib/python2.7/site-packages/pyf/station/__init__.pyc
/usr/lib/python2.7/site-packages/pyf/station/client.py
/usr/lib/python2.7/site-packages/pyf/station/client.pyc
/usr/lib/python2.7/site-packages/pyf/station/main.py
/usr/lib/python2.7/site-packages/pyf/station/main.pyc
/usr/lib/python2.7/site-packages/pyf/station/utils.py
/usr/lib/python2.7/site-packages/pyf/station/utils.pyc
/usr/share/doc/packages/python-pyf-station
/usr/share/doc/packages/python-pyf-station/README.txt

 
ICM