Class: ManqodRPC

Inherits:
Object
  • Object
show all
Includes:
DRb, DRbUndumped, ManqodCommon, Singleton
Defined in:
lib/ManqodRPC.rb

Overview

this file is part of manqod manqod is distributed under the CDDL licence the author of manqod is Dobai-Pataky Balint([email protected])

Constant Summary

Constants included from ManqodCommon

ManqodCommon::CRITICAL, ManqodCommon::DEBUG, ManqodCommon::ERROR, ManqodCommon::INFO, ManqodCommon::NORMAL, ManqodCommon::WARNING

Constants included from Eprint

Eprint::DOMAIN, Eprint::LEVEL

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from ManqodCommon

#add_where, #admin, #admin_cache, #admin_qrow, #admin_rows, #backtrace_to_debug, #cache, #changed_ids_of_base, #client, #client_fields, #client_image_of_id, #client_qrow, #client_query, #client_rows, #eeval, #escape_string, #getBinding, #guess_base, #guess_table, #image_of_id, #lzero, #manqod_db, #measure, #myexec, #nick_id, #number_format, #qrow, #query, #reconnect_manqod_db, #rows, #run_events, #send_message, #sendmail, #set_manqod_db_uri, #set_nick

Methods included from Eprint

#ecode, #edebug, #eerror, #einfo, #enormal, #eprint, #ewarn, #gtk_set_edebug, #set_edebug, #tell_exception

Instance Attribute Details

#client_serverObject (readonly)

Returns the value of attribute client_server.



35
36
37
# File 'lib/ManqodRPC.rb', line 35

def client_server
  @client_server
end

#manqod_serverObject (readonly)

Returns the value of attribute manqod_server.



35
36
37
# File 'lib/ManqodRPC.rb', line 35

def manqod_server
  @manqod_server
end

Instance Method Details

#alive?Boolean

Returns:

  • (Boolean)


10
11
12
# File 'lib/ManqodRPC.rb', line 10

def alive?
	true
end

#connect_to(server_uri) ⇒ Object



16
17
18
# File 'lib/ManqodRPC.rb', line 16

def connect_to(server_uri)
	@manqod_server=DRb::DRbObject.new(nil,server_uri)
end

#nickObject



25
26
27
# File 'lib/ManqodRPC.rb', line 25

def nick
	Nick.instance.get_nick
end

#register_clientObject



22
23
24
# File 'lib/ManqodRPC.rb', line 22

def register_client
	manqod_server.register_client(ManqodRPC.instance.to_s,self,ManqodDB.instance.manqod_db.name.to_s)
end

#rpc(proc) ⇒ Object



31
32
33
34
# File 'lib/ManqodRPC.rb', line 31

def rpc(proc)
	einfo("RPC:#{proc}","main")
	eeval(proc,self)
end

#start_service(client_uri) ⇒ Object



13
14
15
# File 'lib/ManqodRPC.rb', line 13

def start_service(client_uri)
	@client_server=DRb.start_service(client_uri,self)
end

#to_sObject



28
29
30
# File 'lib/ManqodRPC.rb', line 28

def to_s
	"#{Nick.instance.get_nick}@#{@client_server.uri}"
end

#unregister_clientObject



19
20
21
# File 'lib/ManqodRPC.rb', line 19

def unregister_client
	manqod_server.unregister_client(ManqodRPC.instance.to_s)
end