Skip to content

Instantly share code, notes, and snippets.

@kalkin
Created January 7, 2023 12:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kalkin/326c5b9408e31ba4e45a7ad633cb57c4 to your computer and use it in GitHub Desktop.
Save kalkin/326c5b9408e31ba4e45a7ad633cb57c4 to your computer and use it in GitHub Desktop.
import asyncio
# Start the slixmpp Client
client = slixmpp.Client()
client.start()
# Define a new async function
async def my_async_function():
# Perform some asynchronous task here
await asyncio.sleep(1)
print('Hello from my_async_function!')
# Schedule the async function to be run concurrently with the slixmpp Client
asyncio.ensure_future(my_async_function())
# Run the event loop indefinitely
asyncio.get_event_loop().run_forever()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment