More Related Content Similar to Reactsf 2014-message-driven (20) Reactsf 2014-message-driven27. Request 0
Request 1
Request 2
Response 0
Response 1
Response 2
@toddlmontgomery
Async
Requests
&
Responses
Correlation!
28. Request 0
Request 1
Request 2
Response 0
Response 1
Response 2
Ordering
Correlation!
@toddlmontgomery
29. Request 0
Response 0
Request 1
Response 1
Request 2
Response 2
Correlation!
@toddlmontgomery
(Valid)
Re-Ordering
30. Request 0
Response 1
Invalid, Drop We only know of 0.
Handling the Unexpected
@toddlmontgomery
1 is unknown!
33. struct PaymentMessage
{
std::int32_t accountId;
std::int32_t amount;
};
When all you have is binary,
harder to couple and/or conflate
38. TCP connections can…
be closed
unexpectedly
end in an
unknown state
be intercepted
by idiots, er Proxies
39. Which means
Data over TCP* might be…
Duplicated
Re-Ordered
Lost
* - When connections are re-established
42. Which is why
Lock-Free Programming
shares some behaviors
with Protocols…
45. Illusion of Ordering… bordering on “Delusion”
Total Ordering
Message A and B from any 2+ sources
are ordered the same at all destinations
48. Application Layer Framing
0 X bytes
0 1 2 3 4 5 6 7 8
0 1 3 4 5 6 7
2 8
S:
R:
File to Transfer
Recover
Dead Reckoning about Ordering!
Clark and Tennenhouse, ACM SIGCOMM CCR, Volume 20, Issue 4, Sept. 1990
53. public void onAck(final Event ev)
{
switch (currentState)
{
…
case State.FIN_WAIT_1: // an ACK while in FIN_WAIT_1
currentState = State.FIN_WAIT_2;
break;
…
}
}
Event
Current
State
Next
State
State & Events
be explicit, do not hide behind
abstraction(s) Make them Observable!
56. State Machine Testing
1. Does my “code” implement it correctly?
2. Is my design safe, correct, etc.?
VLSI Testing Techniques
e.g. ARC/Branch Testing
58. 2002 ACM System Software Award
SPIN
http://en.wikipedia.org/wiki/SPIN_model_checker
61. Idempotent Unit of Work
ADU
1. Little to no ordering requirement
2. Little to no state requirement
e.g. REST
That stateless bit…
67. @toddlmontgomery
Questions?
• Reactive Manifesto http://www.reactivemanifesto.com
• Kaazing http://www.kaazing.com
• SlideShare http://www.slideshare.com/toddleemontgomery
• Twitter @toddlmontgomery
Thank You!