Slide 1

Slide 1 text

WEBMACHINE THE HTTP TOOLKIT IN RUBY @pawelpacana

Slide 2

Slide 2 text

I’m not a native speaker DISCLAIMER

Slide 3

Slide 3 text

HTTP 1.1 SPEC RFC2616

Slide 4

Slide 4 text

TOOLKIT • „A toolkit for easily creating well- behaved HTTP applications” • not a framework • Sinatra vs. Rails • extracted from Riak

Slide 5

Slide 5 text

RACK INTERFACE app = proc { |env| [ 200, # Status {'Content-Type' => 'text/plain'}, # Headers ["Hello World!"] # Body ] }

Slide 6

Slide 6 text

RACK MIDDLEWARE • Head, ContentLength, ContentType, Deflater, …

Slide 7

Slide 7 text

HTTP IS HARD

Slide 8

Slide 8 text

WEBMACHINE • FSM modelling HTTP • negotiate hard decisions transparently

Slide 9

Slide 9 text

HTTP IS RESOURCES • data or service • identified by URI • representations

Slide 10

Slide 10 text

WEBMACHINE • resources as a core building block • declare resources, don’t perform actions • resource callbacks

Slide 11

Slide 11 text

EXAMPLES show me the code

Slide 12

Slide 12 text

ADAPTERS • WEBrick • Mongrel • Rack* • Reel • Hatetepe

Slide 13

Slide 13 text

ECOSYSTEM • webmachine-test • webmachine-linking • webmachine-actionview • webmachine-sprockets • irwebmachine

Slide 14

Slide 14 text

MY OBSERVATIONS • good as HTTP content delivery mechanism in Ports and Adapters architecture • good for Hypermedia APIs • small enough to read and trust it

Slide 15

Slide 15 text

GOING DEEPER http://bit.ly/resources-for-real-this-time

Slide 16

Slide 16 text

THANK YOU @pawelpacana

Slide 17

Slide 17 text

DRUG #40 NEXT MONDAY 19:00 http://drug.org.pl