of 71 /71
Пара слов про Константин Буркалёв, @KSDaemon MoscowJS, июль 2014

Пара слов про WAMP — Константин Буркалев — MoscowJS 13

Embed Size (px)

DESCRIPTION

Небольшой доклад о протоколе WAMP, его устройстве и архитектуре. А так же о применении в современных веб-приложениях.

Text of Пара слов про WAMP — Константин Буркалев — MoscowJS 13

  • , @KSDaemonMoscowJS, 2014
  • WAMP Windows, Apache, MySQL, PHP
  • , 1 2 : Publish/Subscribe (PubSub)1 Remote Procedure Calls (RPC) = WAMP
  • Realm - , namespace Peer,
  • : URI system.send.le chat.message users.admins.message user.prole.updated
  • integer string bool list (array) dict : JSON MsgPack : : : ,
  • [HELLO, Realm|uri, Details|dict] 1 [PUBLISH, Request|id, Options|dict, Topic|uri] [PUBLISH, Request|id, Options|dict, Topic|uri, Arguments|list] [PUBLISH, Request|id, Options|dict, Topic|uri, Arguments|list, ArgumentsKw|dict] 1 [CALL, Request|id, Options|dict, Procedure|uri] [CALL, Request|id, Options|dict, Procedure|uri, Arguments|list] [CALL, Request|id, Options|dict, Procedure|uri, Arguments|list, ArgumentsKw|dict] 1 [RESULT, CALL.Request|id, Details|dict] [RESULT, CALL.Request|id, Details|dict, YIELD.Arguments|list] [RESULT, CALL.Request|id, Details|dict, YIELD.Arguments|list, YIELD.ArgumentsKw|dict] | Array | List | Hash-table | Dictionary - :
  • Websocket Raw TCP HTTP long-polling ( ) Unix sockets
  • HELLO
  • HELLO WELCOME
  • HELLO WELCOME ABORT
  • HELLO WELCOME GOODBYE ABORT
  • HELLO WELCOME GOODBYE ABORT GOODBYE
  • HELLO WELCOME GOODBYE ABORT GOODBYE GOODBYE
  • HELLO WELCOME GOODBYE ABORT GOODBYE GOODBYE GOODBYE
  • Publish / Subscribe Publisher Broker Subscriber
  • Publish / Subscribe SUBSCRIBE Publisher Broker Subscriber
  • Publish / Subscribe SUBSCRIBE SUBSCRIBED Publisher Broker Subscriber
  • Publish / Subscribe SUBSCRIBE SUBSCRIBED ERROR Publisher Broker Subscriber
  • Publish / Subscribe SUBSCRIBE SUBSCRIBED ERROR PUBLISH Publisher Broker Subscriber
  • Publish / Subscribe SUBSCRIBE SUBSCRIBED ERROR PUBLISH PUBLISHED Publisher Broker Subscriber
  • Publish / Subscribe SUBSCRIBE SUBSCRIBED ERROR PUBLISH PUBLISHED ERROR Publisher Broker Subscriber
  • Publish / Subscribe SUBSCRIBE SUBSCRIBED ERROR PUBLISH PUBLISHED ERROR EVENT Publisher Broker Subscriber
  • Publish / Subscribe SUBSCRIBE SUBSCRIBED UNSUBSCRIBE ERROR PUBLISH PUBLISHED ERROR EVENT Publisher Broker Subscriber
  • Publish / Subscribe SUBSCRIBE SUBSCRIBED UNSUBSCRIBE UNSUBSCRIBED ERROR PUBLISH PUBLISHED ERROR EVENT Publisher Broker Subscriber
  • Publish / Subscribe SUBSCRIBE SUBSCRIBED UNSUBSCRIBE UNSUBSCRIBED ERROR ERROR PUBLISH PUBLISHED ERROR EVENT Publisher Broker Subscriber
  • Remote Procedure Calls Caller Dealer Callee
  • Remote Procedure Calls REGISTER Caller Dealer Callee
  • Remote Procedure Calls REGISTER REGISTERED Caller Dealer Callee
  • Remote Procedure Calls REGISTER REGISTERED ERROR Caller Dealer Callee
  • Remote Procedure Calls REGISTER REGISTERED ERROR CALL Caller Dealer Callee
  • Remote Procedure Calls REGISTER REGISTERED ERROR CALL INVOCATION Caller Dealer Callee
  • Remote Procedure Calls REGISTER REGISTERED ERROR CALL INVOCATION YIELD Caller Dealer Callee
  • Remote Procedure Calls REGISTER REGISTERED ERROR CALL INVOCATION YIELD ERROR Caller Dealer Callee
  • Remote Procedure Calls REGISTER REGISTERED ERROR CALL RESULT INVOCATION YIELD ERROR Caller Dealer Callee
  • Remote Procedure Calls REGISTER REGISTERED ERROR CALL RESULT INVOCATION YIELD ERROR ERROR Caller Dealer Callee
  • Remote Procedure Calls REGISTER REGISTERED UNREGISTER ERROR CALL RESULT INVOCATION YIELD ERROR ERROR Caller Dealer Callee
  • Remote Procedure Calls REGISTER REGISTERED UNREGISTER UNREGISTERED ERROR CALL RESULT INVOCATION YIELD ERROR ERROR Caller Dealer Callee
  • Remote Procedure Calls REGISTER REGISTERED UNREGISTER UNREGISTERED ERROR ERROR CALL RESULT INVOCATION YIELD ERROR ERROR Caller Dealer Callee
  • Basic prole Advanced prole (PubSub, RPC)
  • Advanced prole Heartbeat
  • Advanced prole Publish / Subscribe
  • Advanced prole Remote Procedure Calls RPC
  • Browser Embedded app client Browser Embedded app client Browser Backoffice app client Browser Backoffice app client WAMP Router (realm 1) Browser Embedded app client Browser Embedded app client WAMP Router (realm 2) -
  • Browser Embedded app client Browser Embedded app client Browser Backoffice app client Browser Backoffice app client WAMP Router (realm 1) Browser Embedded app client Browser Embedded app client subscribe to ready.for.chat subscribe to ready.for.chat WAMP Router (realm 2) -
  • Browser Embedded app client Browser Embedded app client Browser Backoffice app client Browser Backoffice app client WAMP Router (realm 1) Browser Embedded app client Browser Embedded app client WAMP Router (realm 2) - subscribe to chat.taken subscribe to chat.taken
  • Browser Embedded app client Browser Embedded app client Browser Backoffice app client Browser Backoffice app client WAMP Router (realm 1) Browser Embedded app client Browser Embedded app client subscribe to user.chat.id1235 WAMP Router (realm 2) -
  • Browser Embedded app client Browser Embedded app client Browser Backoffice app client Browser Backoffice app client WAMP Router (realm 1) Browser Embedded app client Browser Embedded app client publish event to ready.for.chat WAMP Router (realm 2) -
  • Browser Embedded app client Browser Embedded app client Browser Backoffice app client Browser Backoffice app client WAMP Router (realm 1) Browser Embedded app client Browser Embedded app client receive event in ready.for.chat receive event in ready.for.chat WAMP Router (realm 2) -
  • Browser Embedded app client Browser Embedded app client Browser Backoffice app client Browser Backoffice app client WAMP Router (realm 1) Browser Embedded app client Browser Embedded app client publish event to chat.taken WAMP Router (realm 2) -
  • Browser Embedded app client Browser Embedded app client Browser Backoffice app client Browser Backoffice app client WAMP Router (realm 1) Browser Embedded app client Browser Embedded app client receive eventin chat.taken WAMP Router (realm 2) -
  • Browser Embedded app client Browser Embedded app client Browser Backoffice app client Browser Backoffice app client WAMP Router (realm 1) Browser Embedded app client Browser Embedded app client publish event to user.chat.id1235 WAMP Router (realm 2) -
  • Browser Embedded app client Browser Embedded app client Browser Backoffice app client Browser Backoffice app client WAMP Router (realm 1) Browser Embedded app client Browser Embedded app client receive event in user.chat.id1235 WAMP Router (realm 2) -
  • Browser Embedded app client Browser Embedded app client Browser Backoffice app client Browser Backoffice app client WAMP Router (realm 1) Browser Embedded app client Browser Embedded app client subscribe to user.chat.id2425 WAMP Router (realm 2) -
  • Browser Embedded app client Browser Embedded app client Browser Backoffice app client Browser Backoffice app client WAMP Router (realm 1) Browser Embedded app client Browser Embedded app client publish event to ready.for.chat WAMP Router (realm 2) -
  • Browser Embedded app client Browser Embedded app client Browser Backoffice app client Browser Backoffice app client WAMP Router (realm 1) Browser Embedded app client Browser Embedded app client receive event in ready.for.chat receive event in ready.for.chat WAMP Router (realm 2) -
  • Browser Embedded app client Browser Embedded app client Browser Backoffice app client Browser Backoffice app client WAMP Router (realm 1) Browser Embedded app client Browser Embedded app client publish eventto chat.taken WAMP Router (realm 2) -
  • Browser Embedded app client Browser Embedded app client Browser Backoffice app client Browser Backoffice app client WAMP Router (realm 1) Browser Embedded app client Browser Embedded app client receive event in chat.taken WAMP Router (realm 2) -
  • Browser Embedded app client Browser Embedded app client Browser Backoffice app client Browser Backoffice app client WAMP Router (realm 1) Browser Embedded app client Browser Embedded app client publish event to user.chat.id2425 WAMP Router (realm 2) -
  • Browser Embedded app client Browser Embedded app client Browser Backoffice app client Browser Backoffice app client WAMP Router (realm 1) Browser Embedded app client Browser Embedded app client receive event in user.chat.id2425 WAMP Router (realm 2) -
  • Browser Embedded app client Browser Embedded app client Browser Backoffice app client Browser Backoffice app client WAMP Router (realm 1) Browser Embedded app client Browser Embedded app client WAMP Router (realm 2) -
  • Browser Browser Server side infrastructure WAMP Router Mobile Desktop REGISTERRPC REGISTERRPC REGISTERRPC SUBSCRIBE toTOPICs Internal service 1 SUBSCRIBE toTOPICs Internal service 2 Internal service 3 Frontoffice app client Frontoffice app client CRUD Nginx/HAProxy CRUD CRUD Backoffice app client SUBSCRIBE toTOPICs PUBLISHEvent PUBLISHEvent CALL RPCs Nginx/HAProxy Backoffice app client DB CRUD CRUD Backoffice app serverside Frontoffice app serverside
  • ProvidesRPC Publishevents Subscribe totopics ProvidesRPC Publishevents Service Provider 1 Service Provider 2 Service Provider 3 Service Provider 4 Service Provider 5 Publish events WAMP Router (realm 1, realm 2, realm 3, ....) CallRPC CallRPC Subscribe totopics Publishevents Consumer 1 Consumer 2 Consumer 3 Consumer 4 Consumer 5 WAMP SOA
  • WAMP SOA
  • JavaScriptA Autobahn|JS (browser, node.js) Wampy.js (browser) JavaA Autobahn|Android () .NETA WampSharp ( ) PHPA Thurway PythonA Autobahn|Python C++A Autobahn|Cpp ErlangA Erwa Objective-CA MDWamp Lua ( ) PythonA Autobahn|Python Crossbar.io ErlangA Erwa PHPA Thurway LuaA Wiola
  • RPC + PubSub - Open source &
  • http://wamp.wsA https://groups.google.com/group/wampws http://autobahn.ws https://github.com/crossbario/crossbar/wiki Crossbar.io
  • !1 , , ?
  • ! Mail: [email protected] Twitter: @KSDaemon GitHub: KSDaemon Blog: blog.ksdaemon.ru