Skip to content

Hypermedia workflows redux

Erik Mogensen edited this page Sep 8, 2015 · 7 revisions

Hypermedia workflows redux

Hack day proposal

Take the hypermedia "worker" media type built for the 2013 hack day, and build clients that understand how to "make a move" and perhaps "present a board"

The goal is to produce a "workflow-like" system which can play a distributed game of chess.

  • The "Worker" would be given (using the "work needed" media type from 2013).

    • a board with (chess) pieces on it
    • a number of legal moves
    • hypermedia controls to provide the legal move
  • The server would

    • provide various URLs where chess playing workers may seek moves to be made.
    • provide "current board" and "legal moves" to the workers
    • accept the moves made by these workers.

Preparations

Before the event, we need to define the worker media type (already done), along with the language of the board and legal moves (should happen on this page).

Static files should be made to serve as test data for clients, using hypermedia controls to guide them through a fictional game of chess when served using a simple web server.

A "pick the first legal move" client should be built to serve as a tester for servers.

The hack day itself

At the event, some people may already have working chess playing clients or servers, and will wire these together.

Others would build these at the venue, and advertise their server on a github page or on a whiteboard.

Adventurous souls might use <a hrefs> from the github page to start off a random game :)

Arbiter

In addition to the above, where the server knows the rules of chess, a couple of more components could be commissioned at the hack day, in order to produce a server that doesn't know chess either, by adding an "arbiter" to the mix:

  • The ignorant server would (in addition to what the server does):

    • when a client makes "a move" provide a "feed" of decisions to be made to another type of worker, called the arbiter
    • provide the "current board", "chosen move" to the arbiter
    • provide hypermedia controls for the arbiter to make its ruling.
  • The chess arbiter client would:

    • ask the ignorant server for the next "ruling"
    • inspect the board, update it, compile a list of new legal moves,
    • use hypermedia controls provided by the server to provide its results.

Preparations

Before the event, we need to define the arbiter media type (not done, but I have some work in progress).

Static files should be made to serve as test data for arbiter clients, using hypermedia controls to guide them through various chess games when served using a simple web server.

A "compile a list of a couple of random moves" arbiter should be built to serve as a tester for servers.

The hack day itself

Some participants would make arbiters (clients), while others would make servers that could talk to both arbiter and chess playing clients.

Wrap up

If the full proposal is chosen the end result would be:

  • chess playing clients of various types that all can select moves (at random, using AI, asking a human)
  • arbiters that decide if a move is good, the current board, and the list of legal next moves
  • a few servers that service the needs of chess playing clients only
  • a few servers that service the needs of both chess playing clients and arbiters

In the end we should be able to play a good game of chess. Maybe someone will write an arbiter that (when a move has been chosen) uses the Text-to-Speech worker built two years ago to read the moves out loud as they happen, perhaps with witty commentary.

Clone this wiki locally