USSD Renderer Redux

3,220 views

Published on

A presentation introducing a new USSD framework in Ruby.

Published in: Technology, Business
1 Comment
4 Likes
Statistics
Notes
  • where can I find the repository of the project ? sounds like a great idea , ruby should support more GSM services , like SIM toolkit , USSD , SS7 and more .
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
No Downloads
Views
Total views
3,220
On SlideShare
0
From Embeds
0
Number of Embeds
19
Actions
Shares
0
Downloads
90
Comments
1
Likes
4
Embeds 0
No embeds

No notes for slide

USSD Renderer Redux

  1. 1. USSD Renderer ReduxMobME Engineering Saturdays 002Vishnu Gopal
  2. 2. AgendaWhy Redux?Implementation Evented & Synchrony Redux InternalsCalculator using ReduxNext Steps
  3. 3. Why Redux? Mobile Subscriber Mobile Network Operator USSD Device MobME Server USSD App
  4. 4. Why Redux? 98468190XX Vodafone Comviva USSD Gateway USSD Renderer Redux USSD Flow
  5. 5. Why Redux? Comviva USSD Gateway MS Mobile Subscriber MS Initiated MS -> USSD Network Initiated USSD -> MS Request USSD -> MS Response MS -> USSD Notify USSD -> MS (end) USSD Renderer Redux
  6. 6. Why Redux? HTTP USSD Fast, < 0.5s Slow, > 5s Multiple resources Single simple response Minimal sessions Lots of sessions Stateless Stateful Cookies, pipelining, No extra HTTP etc. features.
  7. 7. Why Redux? Comviva USSD Gateway Protocol HTTP A USSD Response is converted to a HTTP Request with these parameters: msisdn, input, shortcode USSD Renderer Redux
  8. 8. Why Redux?http://host:port/ussd-121?msisdn=<msisdn>&input= “Welcome to 121! Press 1 for Umbrellas and 2 for Raincoats”http://host:port/ussd-121?msisdn=<msisdn>&input=2 “Thank you for choosing Raincoats. A customer service representative will shortly give you a call.”
  9. 9. Why Redux? Forking Processes Mature, USSD truckload of Python & YAML features Renderer Not TDDed Procedural
  10. 10. Why Redux? Evented Baby, subset of USSD Ruby features Renderer Redux Classes, TDDed Modular, Helpers
  11. 11. Implementation: Evented MS USSD Worker Process USSD Renderer MS USSD Worker Process MS Reusable USSD Worker Process Worker Pool -> MS USSD Worker Process Worker Exhaustion When Requests are Slow
  12. 12. Implementation: Evented MS USSD Renderer MS USSD Worker Process Single MS Threaded Evented Worker -> MS Less memory, Less Can only saturate one core CPU
  13. 13. Implementation: EventedWorks the same way CPUs workPauses a request and handles another when it iswaiting for input and output. Keyboard input/output Network requests, like HTTP API calls.When the request finishes, a callback is fired to let therequest know status (error or success)
  14. 14. Implementation: Evented A B USSD MS-1 Renderer USSD Worker Process Operator Balance D Single C API (slow) Threaded Evented MS-2 Worker -> Once C is finished, MS-1 receives a callback on success, errback on failure
  15. 15. Implementation: Eventeda = EM::HTTPRequest.new(“http://google.com/”).geta.callback { p a.response }a.errback { p a.response_header.status }
  16. 16. Implementation: Synchronya = EM::HTTPRequest.new(“http://google.com/”).getif a.response_header.status == 500 p “error”else p a.responseend
  17. 17. Implementation: Redux Request Input Process Request Notify
  18. 18. Implementation: Redux Request Request Node 1 Node 2 Input Input Process Process Notify
  19. 19. Implementation: Reduxindex { request { prompt “Enter your name:” } process { |input| notify “Hello #{input}!” }}
  20. 20. Implementation: Reduxindex { age { request { request { prompt “Enter your name:” prompt “Enter your age:” } } process { |input| process { |input| session[:name] = input notify “Hello #{input} year old #{session[:name]}” switch :age } } }}
  21. 21. Writing a Redux Calculator
  22. 22. Next StepsLots more features! Menu pagination with prefixes and suffixes Message interpolation Redis session store Lots of helpers for common tasks: redis, mysql, url callsPlay around with the template to create your ownUSSD app!
  23. 23. Finis.Questions?

×