Skip to content

Instantly share code, notes, and snippets.

View rob-blackbourn's full-sized avatar
💭
Trying to do a proper "Hello, World!" with wasm

Rob Blackbourn rob-blackbourn

💭
Trying to do a proper "Hello, World!" with wasm
View GitHub Profile
@rob-blackbourn
rob-blackbourn / graphene3-demo-app.py
Created October 8, 2020 08:06
Graphene 3 example ASGI application
import os
from typing import Any, Mapping
from bareasgi import Application
from bareasgi_cors import CORSMiddleware
from bareasgi_graphql_next.graphene import add_graphene
from baretypes import (
Scope,
Info,
Message
@rob-blackbourn
rob-blackbourn / graphene3-demo-schema.py
Created October 8, 2020 08:09
Graphene 3 example schema
import graphene
from .queries import Query
from .mutations import Mutations
from .subscriptions import Subscription
SCHEMA = graphene.Schema(query=Query, mutation=Mutations, subscription=Subscription)
@rob-blackbourn
rob-blackbourn / graphene3-demo-server.py
Created October 8, 2020 08:12
Graphene 3 example server
import asyncio
import signal
from typing import Any, Mapping
from bareasgi import Application
import pkg_resources
import hypercorn.asyncio
import hypercorn.config
from demo.app import make_application
@rob-blackbourn
rob-blackbourn / client.py
Created May 23, 2023 18:18
Using asyncio start_tls with Python 3.11
"""
Example Client
The client connects without TLS, but using the fully qualified domain name. To
authenticate the server, the FQDN is required. This can be specified either at
connection time, or with the start_tls call.
First the client sends a "PING" over the unencrypted stream to the server. The
server should respond with "PONG".