mirror of
https://github.com/mistergibson/gxg-framework.git
synced 2026-08-15 03:46:00 -07:00
federation fixes
This commit is contained in:
parent
3f05e092ee
commit
2bfa33874e
2 changed files with 12 additions and 7 deletions
|
|
@ -1,6 +1,6 @@
|
|||
Gem::Specification.new do |s|
|
||||
s.name = 'gxg-framework'
|
||||
s.version = '0.0.63'
|
||||
s.version = '0.0.64'
|
||||
s.licenses = ['HIPPOCRATIC 2.1', 'https://firstdonoharm.dev/version/2/1/license.html']
|
||||
s.summary = "GxG Framework"
|
||||
s.description = "GxG Framework"
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ module GxG
|
|||
module Messages
|
||||
class Channel
|
||||
#
|
||||
def initialize(the_uuid)
|
||||
def initialize(the_uuid=nil, the_object=nil)
|
||||
@uuid = the_uuid
|
||||
@inbox = []
|
||||
@inbox_safety = ::Mutex.new
|
||||
|
|
@ -25,6 +25,7 @@ module GxG
|
|||
@socket = nil
|
||||
@remote = nil
|
||||
@channel_secret = nil
|
||||
@object = the_object
|
||||
self
|
||||
end
|
||||
#
|
||||
|
|
@ -32,6 +33,10 @@ module GxG
|
|||
@uuid
|
||||
end
|
||||
#
|
||||
def object()
|
||||
@object
|
||||
end
|
||||
#
|
||||
def socket()
|
||||
@socket
|
||||
end
|
||||
|
|
@ -148,8 +153,8 @@ module GxG
|
|||
GXG_FEDERATION_SAFETY.synchronize { GXG_FEDERATION[:connections][(the_uuid)] }
|
||||
end
|
||||
#
|
||||
def create_channel(the_uuid)
|
||||
GXG_FEDERATION_SAFETY.synchronize { GXG_FEDERATION[:connections][(the_uuid)] = ::GxG::Messages::Channel.new(the_uuid)}
|
||||
def create_channel(the_uuid=nil, the_object=nil)
|
||||
GXG_FEDERATION_SAFETY.synchronize { GXG_FEDERATION[:connections][(the_uuid)] = ::GxG::Messages::Channel.new(the_uuid,the_object)}
|
||||
end
|
||||
#
|
||||
def destroy_channel(the_uuid)
|
||||
|
|
@ -999,7 +1004,7 @@ class Object
|
|||
def send_message(the_message)
|
||||
unless @uuid
|
||||
@uuid = ::GxG::uuid_generate.to_s.to_sym
|
||||
::GxG::CHANNELS.create_channel(@uuid)
|
||||
::GxG::CHANNELS.create_channel(@uuid,self)
|
||||
end
|
||||
::GxG::CHANNELS.send_message(@uuid, the_message)
|
||||
true
|
||||
|
|
@ -1008,7 +1013,7 @@ class Object
|
|||
def next_message()
|
||||
unless @uuid
|
||||
@uuid = ::GxG::uuid_generate.to_s.to_sym
|
||||
::GxG::CHANNELS.create_channel(@uuid)
|
||||
::GxG::CHANNELS.create_channel(@uuid,self)
|
||||
end
|
||||
::GxG::CHANNELS.next_message(@uuid)
|
||||
end
|
||||
|
|
@ -1016,7 +1021,7 @@ class Object
|
|||
def post(the_message)
|
||||
unless @uuid
|
||||
@uuid = ::GxG::uuid_generate.to_s.to_sym
|
||||
::GxG::CHANNELS.create_channel(@uuid)
|
||||
::GxG::CHANNELS.create_channel(@uuid,self)
|
||||
end
|
||||
channel = ::GxG::CHANNELS.fetch_channel(@uuid)
|
||||
if channel
|
||||
|
|
|
|||
Loading…
Reference in a new issue