pywebpush
pywebpush copied to clipboard
Async Send Function
I'm kinda surprised there's not more issues regarding async besides #142
Is adding an async send_async
function something you would be interested in adding to the library?
I haven't worked out an implementation yet, but I'm open to doing so if there's interest in merging. Although, it would likely involve removing the requests
dependency and replacing it with httpx which implements the requests interface but also provides an async client.
Not really? I mostly consider this library to be just an assist sort of thing. Anything that wanted to do heavier lifting would just call the functions in WebPusher
directly. You could call Webpusher.encode()
directly without going though the send
bits, or fabricate your own send
using that function as an example.
I can see possibly extracting the header fixup stuff from send
into their own function, but those tend to be a bit specific for the push transaction.