Class: Arpie::EventedClient

Inherits:
Client
  • Object
show all
Defined in:
lib/arpie/client.rb

Overview

A simple pseudo event-based client, using a thread with a callback.

Instance Attribute Summary

Attributes inherited from Client

#connect_retry, #connect_sleep, #protocol

Instance Method Summary collapse

Methods inherited from Client

#connect, #initialize, #io_retry, #on_error, #read_message, #write_message

Constructor Details

This class inherits a constructor from Arpie::Client

Instance Method Details

#handle(&handler) ⇒ Object

Set a callback for incoming messages.



121
122
123
# File 'lib/arpie/client.rb', line 121

def handle &handler #:yields: client, message
  @handler = handler
end