Skip to content

Commit

Permalink
fixed assert in topic
Browse files Browse the repository at this point in the history
  • Loading branch information
semiversus committed Sep 19, 2018
1 parent 156fc84 commit 010b1a6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions broqer/hub/hub.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,13 +134,13 @@ def emit(self, value: Any,
self._pre_assign_emit.append(value)
return None

assert isinstance(self._subject, Subscriber), \
'Topic %r has to be a Subscriber when using .emit()' % self._path

# notify all subscribers when the source of the .emit is the subject
if who is self._subject:
return self.notify(value)

assert isinstance(self._subject, Subscriber), \
'Topic %r has to be a Subscriber when using .emit()' % self._path

# otherwise pass this .emit to the subject
return self._subject.emit(value, who=self)

Expand Down

0 comments on commit 010b1a6

Please sign in to comment.