Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
This project is based on lightstreamer-client
pip install async-lightstreamer
# or if you are using poetry
poetry add async-lightstreamer
This client creates a task for receving new messages You can pass TaskGroup to LightstreamerClient, and client will use given TaskGroup for creating task
async with asyncio.TaskGroup() as tg:
async_lightstreamer.LightstreamerClient(
lightstreamer_username="<username>",
lightstreamer_password="<password>",
lightstreamer_url="<url>",
adapter_set="<adapter>",
task_group=tg,
)
If you set should_reconnect
flag to true in LightstreamerClient, client will reconnect
and subscribe all subscriptions
async_lightstreamer.LightstreamerClient(
lightstreamer_username="<username>",
lightstreamer_password="<password>",
lightstreamer_url="<url>",
adapter_set="<adapter>",
should_reconnect = True,
reconnect_retries = 100, # set to -1 for infitine retry
)
import asyncio
import async_lightstreamer
async def main():
lc = async_lightstreamer.LightstreamerClient(
lightstreamer_username="<username>",
lightstreamer_password="<password>",
lightstreamer_url="<url>",
adapter_set="<adapter>",
)
await lc.connect()
async def callback(data) -> None:
print(data)
await lc.subscribe(
subscription=async_lightstreamer.LightstreamerSubscription(
mode=async_lightstreamer.Mode.MERGE,
items=["item1", "item2"],
fields=["field1", "field2"],
adapter="adapter",
).addlistener(callback),
)
await asyncio.sleep(60)
await lc.disconnect()
asyncio.run(main())
FAQs
Unknown package
We found that async-lightstreamer demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.