fix things back to the previous point of not working

This commit is contained in:
Brian Warner 2017-02-26 04:03:54 -08:00
parent 26adaabe18
commit 1beae97ec4
4 changed files with 12 additions and 6 deletions

View File

@ -55,7 +55,7 @@ class Boss(object):
self._O.wire(self._K, self._R) self._O.wire(self._K, self._R)
self._K.wire(self, self._M, self._R) self._K.wire(self, self._M, self._R)
self._R.wire(self, self._K, self._S) self._R.wire(self, self._K, self._S)
self._RC.wire(self, self._M, self._C, self._NL) self._RC.wire(self, self._N, self._M, self._C, self._NL, self._T)
self._NL.wire(self._RC, self._C) self._NL.wire(self._RC, self._C)
self._C.wire(self, self._RC, self._NL) self._C.wire(self, self._RC, self._NL)
self._T.wire(self, self._RC, self._N, self._M) self._T.wire(self, self._RC, self._N, self._M)

View File

@ -154,7 +154,7 @@ class Mailbox(object):
@m.output() @m.output()
def record_mood_and_RC_tx_close(self, mood): def record_mood_and_RC_tx_close(self, mood):
self._mood = mood self._mood = mood
self._RC_rx_close() self._RC_tx_close()
@m.output() @m.output()
def ignore_mood_and_T_mailbox_done(self, mood): def ignore_mood_and_T_mailbox_done(self, mood):
self._T.mailbox_done() self._T.mailbox_done()

View File

@ -142,3 +142,5 @@ class Nameplate(object):
S5A.upon(connected, enter=S5B, outputs=[]) S5A.upon(connected, enter=S5B, outputs=[])
S5B.upon(lost, enter=S5A, outputs=[]) S5B.upon(lost, enter=S5A, outputs=[])
S5.upon(release, enter=S5, outputs=[]) # mailbox is lazy
S5.upon(close, enter=S5, outputs=[])

View File

@ -84,11 +84,13 @@ class RendezvousConnector(object):
# TODO: Tor goes here # TODO: Tor goes here
return endpoints.HostnameEndpoint(self._reactor, hostname, port) return endpoints.HostnameEndpoint(self._reactor, hostname, port)
def wire(self, boss, mailbox, code, nameplate_lister): def wire(self, boss, nameplate, mailbox, code, nameplate_lister, terminator):
self._B = _interfaces.IBoss(boss) self._B = _interfaces.IBoss(boss)
self._N = _interfaces.INameplate(nameplate)
self._M = _interfaces.IMailbox(mailbox) self._M = _interfaces.IMailbox(mailbox)
self._C = _interfaces.ICode(code) self._C = _interfaces.ICode(code)
self._NL = _interfaces.INameplateLister(nameplate_lister) self._NL = _interfaces.INameplateLister(nameplate_lister)
self._T = _interfaces.ITerminator(terminator)
# from Boss # from Boss
def start(self): def start(self):
@ -133,6 +135,7 @@ class RendezvousConnector(object):
self._ws = proto self._ws = proto
self._tx("bind", appid=self._appid, side=self._side) self._tx("bind", appid=self._appid, side=self._side)
self._C.connected() self._C.connected()
self._N.connected()
self._M.connected() self._M.connected()
self._NL.connected() self._NL.connected()
@ -157,12 +160,13 @@ class RendezvousConnector(object):
dmsg(self._side, "R.lost") dmsg(self._side, "R.lost")
self._ws = None self._ws = None
self._C.lost() self._C.lost()
self._N.lost()
self._M.lost() self._M.lost()
self._NL.lost() self._NL.lost()
# internal # internal
def _stopped(self, res): def _stopped(self, res):
self._M.stopped() self._T.stopped()
def _tx(self, mtype, **kwargs): def _tx(self, mtype, **kwargs):
assert self._ws assert self._ws
@ -208,7 +212,7 @@ class RendezvousConnector(object):
def _response_handle_claimed(self, msg): def _response_handle_claimed(self, msg):
mailbox = msg["mailbox"] mailbox = msg["mailbox"]
assert isinstance(mailbox, type("")), type(mailbox) assert isinstance(mailbox, type("")), type(mailbox)
self._M.rx_claimed(mailbox) self._N.rx_claimed(mailbox)
def _response_handle_message(self, msg): def _response_handle_message(self, msg):
side = msg["side"] side = msg["side"]
@ -218,7 +222,7 @@ class RendezvousConnector(object):
self._M.rx_message(side, phase, body) self._M.rx_message(side, phase, body)
def _response_handle_released(self, msg): def _response_handle_released(self, msg):
self._M.rx_released() self._N.rx_released()
def _response_handle_closed(self, msg): def _response_handle_closed(self, msg):
self._M.rx_closed() self._M.rx_closed()