comparison README.md @ 31:8d908762fe1e

rewrite for starlette
author drewp@bigasterisk.com
date Sun, 24 Apr 2022 00:47:41 -0700
parents c3f0a692c4cb
children
comparison
equal deleted inserted replaced
30:43cbbb685410 31:8d908762fe1e
13 graph. `rdfdb.grapheditapi.GraphEditApi` is mixed in, so you can 13 graph. `rdfdb.grapheditapi.GraphEditApi` is mixed in, so you can
14 use 14 use
15 [higher-level functions](https://bigasterisk.com/darcs/?r=rdfdb;a=headblob;f=/rdfdb/grapheditapi.py) from 15 [higher-level functions](https://bigasterisk.com/darcs/?r=rdfdb;a=headblob;f=/rdfdb/grapheditapi.py) from
16 there, such as patchObject. 16 there, such as patchObject.
17 17
18 Web serving: 18 Web serving with starlette:
19 19
20 ``` from patchablegraph import CycloneGraphHandler, 20 ```
21 CycloneGraphEventsHandler 21 from patchablegraph.handler import StaticGraph, GraphEvents
22 22
23 reactor.listenTCP(9059, cyclone.web.Application([ 23 masterGraph = PatchableGraph()
24 ... 24
25 (r"/graph", CycloneGraphHandler, {'masterGraph': masterGraph}), 25 app = Starlette(
26 (r"/graph/events", CycloneGraphEventsHandler, {'masterGraph': masterGraph}), 26 routes=[
27 ... 27 Route('/graph/environment', StaticGraph(masterGraph)),
28 Route('/graph/environment/events', GraphEvents(masterGraph)),
29 ...
30 ])
31
28 ``` 32 ```
29 33
34 * Versions 0.x.x used cyclone web and twisted.
35 * Versions 1.x.x use starlette and asyncio.