dw / py-lightstreamer Goto Github PK
View Code? Open in Web Editor NEWLightstreamer HTTP client for Python
Home Page: https://py-lightstreamer.readthedocs.org/
License: Other
Lightstreamer HTTP client for Python
Home Page: https://py-lightstreamer.readthedocs.org/
License: Other
py-lightstreamer doesn't work with Python 3.x and requires patching.
I am preparing a patch that should address this (as well as keeping Python 2.x compatibility).
I will file a pull request, but in the meantime I prefer tracking the issue here.
Full disclosure: I work for Weswit (Lightstreamer).
Hello,
you might add continuous integration (with Travis CI for example)
it will help to ensure that it is working fine both with Python 2 and Python 3.
Kind regards
I've tried out the Lightstreamer python demo script, but since it only supports paid editions of the Lightstreamer server, I'm having a go with py-lightstreamer instead.
After modifying your barebones example to work with your current script (replacing client.on_connection_state()
with client.on_state.listen()
and table.on_update()
with table.on_update.listen()
) and substituting the parameters from the Basic Stock-List demo, I end up with this:
import lightstreamer
def on_connection_state(state):
print 'CONNECTION STATE:', state
if state == lightstreamer.STATE_DISCONNECTED:
connect()
def on_update(item_id, row):
print 'UPDATE!', row
def connect():
client.create_session(username='', adapter_set='DEMO')
table = lightstreamer.Table(client, item_ids='item1|item2', schema='stock_name|last_price',
mode=lightstreamer.MODE_MERGE, data_adapter="MONITOR")
table.on_update.listen(on_update)
client = lightstreamer.LsClient('http://push.lightstreamer.com/')
client.on_state.listen(on_connection_state)
connect()
raw_input('Press CR to exit')
client.destroy()
client.join()
However, upon running this in Python 2.7, the connection state endlessly switches between connecting
and disconnected
. What am I doing wrong?
I suppose my real question should be: Will py-lightstreamer work with the Moderato edition of Lightstreamer, with its very limited selection of client APIs? I'm guessing the answer is probably going to be no.
Cheers,
Jon
When trying to create a session, the state will be "disconnected" immediately and after then an error follows: No handlers could be found for logger "lightstreamer"
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.