mod (owner)

Revisions

gist: 206440 Download_button fork
public
Public Clone URL: git://gist.github.com/206440.git
Embed All Files: show embed
Ruby #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
      def workflow
        state :parse do |status, arg|
          if status == :error
            run(:reply, arg)
          else
            run(:send, arg.last) if @srv[:amqp]
            run(:rank, *arg)
          end
        end
 
        state :rank do |status, arg|
          if status == :fatal
            run(:stop, arg)
          else
            run(:reply, arg)
          end
        end
 
        state :send do |status, arg|
          run(:stop, arg) if status == :fatal
        end
 
        state :reply do |status, arg|
          run(:stop, arg) if status == :fatal
        end
 
        state(:stop)
      end