本文整理汇总了Python中agentzero.core.SocketManager.sockets["bad-one"]方法的典型用法代码示例。如果您正苦于以下问题:Python SocketManager.sockets["bad-one"]方法的具体用法?Python SocketManager.sockets["bad-one"]怎么用?Python SocketManager.sockets["bad-one"]使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类agentzero.core.SocketManager
的用法示例。
在下文中一共展示了SocketManager.sockets["bad-one"]方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_socket_manager_ignore_exceptions_when_cleaning_up_sockets
# 需要导入模块: from agentzero.core import SocketManager [as 别名]
# 或者: from agentzero.core.SocketManager import sockets["bad-one"] [as 别名]
def test_socket_manager_ignore_exceptions_when_cleaning_up_sockets():
("SocketManager.__del__() should should ignore errors when cleaning up sockets")
# Given a bad socket that raises an exception upon calling .close()
class BadSocket(object):
def close(self):
raise RuntimeError("This is the exception that should be ignored")
# And a SocketManager instance containing that poisened socket
manager = SocketManager(zmq, context)
manager.sockets["bad-one"] = BadSocket()
# When the manager gets wipe out of the memory
del manager