Skip to main content

Easy client-server communication

Project description

Hoist

Easy client-server communication

Quick Example

import hoist

server = hoist.start("test") # set "test" as the authentication key

@server.receive("hello")
async def hello(socket: hoist.Message, payload: dict) -> None:
    print("server got hello")
    await message.reply("hi")
import hoist

@hoist.connect_to("http://localhost:5000", "test") # log in to the server with key "test"
async def main(server: hoist.Connection):
    @server.receive("hi")
    async def hello(message: hoist.Message, payload: dict):
        print("client got hi")

    await server.message("hello")

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hoist_http-1.0.0a3.tar.gz (27.1 kB view hashes)

Uploaded Source

Built Distribution

hoist_http-1.0.0a3-py3-none-any.whl (30.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page