def filter(self, msg_type=None, maxsize=<NUM_LIT:0>):
if self._dead:<EOL><INDENT>return iter(())<EOL><DEDENT>iterator = Handler._SBPQueueIterator(maxsize)<EOL>ref = weakref.ref(iterator)<EOL>self._sinks.append(ref)<EOL>def feediter(msg, **metadata):<EOL><INDENT>i = ref()<EOL>if i is not None:<EOL><INDENT>i(msg, **metadata)<EOL><DEDENT>else:<EOL><INDENT>raise Handler._DeadCallbackException<EOL><DEDENT><DEDENT>self.add_callback(feediter, msg_type)<EOL>return iterator<EOL>
Get a filtered iterator of messages for synchronous, blocking use in
another thread.