Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
51 lines (34 sloc) 1.01 KB
Messed...
has a loop -> paths.. dispatching
listens to a source
dispatches to the loop
responds (optionally)
goes back to listening.
class Hello
def say
say "you're super awesome"
end
def jerks
say "you're super awesome jerk"
end
end
Messed.new do
for 'hey you', :class => 'hello', :action => 'say'
for 'hey you jerks', :class => 'hello', action => 'jerks'
for 'hey you', :requirements => {:source => :from_friends} do
say 'hey hey'
reply 'nice to see you guy'
whisper 'okay sure'
end
end
models for incoming ->
server
-> boot up em,
-> if its a poller, start the polling interval, and run the block ...
-> if its a listener, start
Models for incoming...
Polling w/ intervals
Holding open a socket and streaming
Listening on a path, and doing something with the incoming request
TODO
- [BG] Deal with duplicate messages. Consider a message "duplicate" if the sender and content is the same and it was sent within 30 seconds of the previous duplicate message.