Coder Social home page Coder Social logo

aiosseclient's People

Contributors

dwatrous avatar ebraminio avatar goliatone avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

aiosseclient's Issues

How to handle 401 and expired credentials

I am operating against the Firebase Realtime Database.

I have the following code

import threading
from time import sleep

url = "https://databaseurl/messages.json?auth=idtoken"

async def message_reader():
    async for event in aiosseclient(url):
        print(event.event)
        print(event)

message_reader_thread = threading.Thread(target=asyncio.run, args=(message_reader(),))
message_reader_thread.start()

while True:
    print("Still reading messages")
    sleep(30)

This code works, but breaks in two cases that I can't understand how to handle. First is when the idtoken is bad and response gets a 401 back. The While loop still runs, but there is no error or way to exit the for loop. The second is when idtoken expires (they only last an hour) and an event "auth_revoked" is received. Again, there is no way to observe the error, and the for loop keeps going because it is still getting "keep-alive" events, even though it's not receiving data anymore.

I need some way to have the script fail and exit on 401 and I need a way to somehow refresh/restart it with a new idtoken periodically (hourly in this case).

Filtering example

Thabks a lot for writing and sharing this โค
I just build a small script/bot using this and mediawikiapi.
I have a suggestion to expand he readme with a filtering example, woukd that be accepted?

Chunk too big error

The library works for me, but when receiving very large messages/packets an error is generated: "Chunk too big"

image

I would like to have an option to just ignore these very large chunks, or if it were possible to get them normally without any errors.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.