Skip to content

Instantly share code, notes, and snippets.

View hwinkel's full-sized avatar

Holger Winkelmann hwinkel

View GitHub Profile
@hwinkel
hwinkel / Event-stream based GraphQL subscriptions.md
Created February 6, 2016 20:38 — forked from OlegIlyenko/Event-stream based GraphQL subscriptions.md
Event-stream based GraphQL subscriptions for real-time updates

In this gist I would like to describe an idea for GraphQL subscriptions. It was inspired by conversations about subscriptions in the GraphQL slack channel and different GH issues, like #89 and #411.

Conceptual Model

At the moment GraphQL allows 2 types of queries:

  • query
  • mutation

Reference implementation also adds the third type: subscription. It does not have any semantics yet, so here I would like to propose one possible semantics interpretation and the reasoning behind it.

@hwinkel
hwinkel / skipgraph.erl
Created January 31, 2012 08:03 — forked from dchiji/skipgraph.erl
Skip Graph in Erlang
-module(sg).
-export([start/0, start/1, get_node/0, find_/1, put_/2, get_/1, get_/2]).
-define(error(X), (begin io:format("*** ERROR ~p ~p ~p~n", [?MODULE, ?LINE, X]) end)).
-define(debug(X), (begin io:format("*** DEBUG ~p ~p ~p~n", [?MODULE, ?LINE, X]) end)).
start() -> register(node_loop, spawn(fun() -> node_loop(boot(dummy_node(), 0, 0)) end)).
start(Init) ->
Pid = rpc:call(Init, sg, get_node, []),
register(node_loop, spawn(fun() -> node_loop(Pid) end)).