Skip to content

Instantly share code, notes, and snippets.

@pcarrier
Last active September 11, 2021 02:12
Show Gist options
  • Save pcarrier/00a037c70899b5982a5d3512a3f0126d to your computer and use it in GitHub Desktop.
Save pcarrier/00a037c70899b5982a5d3512a3f0126d to your computer and use it in GitHub Desktop.
import {actor, RefActor, state} from 'RefActor';
export default (id)=>({ref:actor(id, state.init), state}) : RefActor;
export async function react({in:Message}): Promise<Result<Boolean>>
export async function onHTTP({method,headers,..}:HTTPRequest): Promise<HTTPResponse>
$ brew install blorg
$ blorg attach $secret pierre
$ blorg ssh-agent pierre
$ blorg join blorg11.rdv.to blorg0.rdv.to blorg3.rdv.to
First entry for blorg3.rdv.to, blorg11.rdv.to
blorg3.rdv.to[VTIxMKH9WdKec4igy8Y,v6-ildPQyp2QdhNImdb.beXA] joined blorg0.rdv.to, blorg1.rdv.to, blorg2.rdv.to, and 7 others
blorg11.rdv.to[n6Dl0uzS5tHjVsy1A2Yw5K-K,VATgPZru2AXWuUboFmg] joined blorg0.rdv.to, blorg1.rdv.to, blorg2.rdv.to, and 8 others
$ blorg bring chat git/chat
$ cd git/chat; blorg send
$ blorg label pchat pierre/chat
$ blorg browse pchat as pierre
/*
Double-entry bookkeeping for your distributed brains.
bar1.net: core-web http+websocket
bar0.net: transactional bar1 bar features, http+websocket
bar2.net: would be the soyuz cloud for everybody, but maybe build your own easily enough instead? http+websocket+webrtc
$domain/foo [frames] to ${mangle(resolve(foo))}.$domain/bar, a/bar is passthrough for bar
rdv.to hosts the rdv.to frontend and proxies
GET,PUT,POST,DELETE foo/bar/baz//hello/world
context = foo/bar/baz
path = hello/world
*/
async function history(): Promise<History>
async function state(): Promise<State>
async function send({message:Message, channel:Channel}): Promise<Result<Boolean>>
interface HistoryNode { async function parents(): Promise<List<HistoryNode>>
async function state(): Promise<State>
async function message(): Promise<Message>
async function remote(): Promise<Result<Remote>>
async function id(): Promise<Result<Remote>> }
interface History { async function head(): Promise<HistoryNode>
async function length(): Promise<Result<number>>
async function trim(length: number): Promise<Result<Boolean>> }
interface File { content: any }
type Key = string
type Listing = Record<Key, State>
type State = File | Listing
type Message = any
type Secret = string
interface Channel { local: Local; remote: Remote }
interface Identity { key: string; alias?: string }
interface Remote implements Identity { iri: string }
interface Local implements Remote { secret: Secret }
export async function http({method,headers,..}:HTTPRequest): Promise<HTTPResponse>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment