Skip to content

Life Cycle Example

Mohamed Motaweh edited this page Oct 10, 2022 · 1 revision
sequenceDiagram
  User ->> App Server: Send Sms to 05000500
  App Server ->> App Server : Valid Phone Number?

  par If number is invalid?
    App Server ->> User : 422
    Note over App Server,User: Invalid Number
  and If number is valid?
    App Server ->> Redis : fetch ("{topic}:{id}:60", "{topic}:{id}:300")
    App Server ->> App Server : Any Window Exceeded?
    par If Window Exceeded?
     App Server ->> User : 429
     Note over App Server,User: Limit Exceeded, Try again later
    and If No Window Exceeded?
      App Server ->> App Server : Execute given block
      App Server ->> Redis : Increment ("{topic}:{id}:60", "{topic}:{id}:300")
      App Server ->> User : 200
      Note over App Server,User: Success
    end
  end
Loading
Clone this wiki locally