本文整理匯總了Python中wishbone.event.Event.appendBulk方法的典型用法代碼示例。如果您正苦於以下問題:Python Event.appendBulk方法的具體用法?Python Event.appendBulk怎麽用?Python Event.appendBulk使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類wishbone.event.Event
的用法示例。
在下文中一共展示了Event.appendBulk方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_module_unpack
# 需要導入模塊: from wishbone.event import Event [as 別名]
# 或者: from wishbone.event.Event import appendBulk [as 別名]
def test_module_unpack():
actor_config = ActorConfig('unpack', 100, 1, {}, "")
unpack = Unpack(actor_config)
unpack.pool.queue.inbox.disableFallThrough()
unpack.pool.queue.outbox.disableFallThrough()
unpack.start()
bulk = Event(bulk=True)
for _ in range(0, 10):
bulk.appendBulk(Event())
unpack.pool.queue.inbox.put(bulk)
for _ in range(0, 10):
assert getter(unpack.pool.queue.outbox)
try:
getter(unpack.pool.queue.outbox)
except Exception:
assert True
else:
assert False
示例2: test_event_appendBulk
# 需要導入模塊: from wishbone.event import Event [as 別名]
# 或者: from wishbone.event.Event import appendBulk [as 別名]
def test_event_appendBulk():
e = Event(bulk=True)
ee = Event({"one": 1})
e.appendBulk(ee)
assert e.dump()["data"][0]["uuid"] == ee.data["uuid"]
示例3: test_extractBulkItemValues
# 需要導入模塊: from wishbone.event import Event [as 別名]
# 或者: from wishbone.event.Event import appendBulk [as 別名]
def test_extractBulkItemValues():
from wishbone.event import extractBulkItemValues
e = Event(bulk=True)
e.appendBulk(Event({"one": 1}))
e.appendBulk(Event({"two": 2}))
e.appendBulk(Event({"three": 3}))
for item in extractBulkItemValues(e, "data"):
assert item in [{"one": 1}, {"two": 2}, {"three": 3}]
示例4: test_extractBulkItems
# 需要導入模塊: from wishbone.event import Event [as 別名]
# 或者: from wishbone.event.Event import appendBulk [as 別名]
def test_extractBulkItems():
from wishbone.event import extractBulkItems
e = Event(bulk=True)
e.appendBulk(Event({"one": 1}))
e.appendBulk(Event({"two": 2}))
e.appendBulk(Event({"three": 3}))
for item in extractBulkItems(e):
assert isinstance(item, Event)
示例5: test_event_appendBulkFull
# 需要導入模塊: from wishbone.event import Event [as 別名]
# 或者: from wishbone.event.Event import appendBulk [as 別名]
def test_event_appendBulkFull():
e = Event(bulk=True, bulk_size=1)
ee = Event({"one": 1})
e.appendBulk(ee)
try:
e.appendBulk(ee)
except BulkFull:
assert True
else:
assert False
示例6: test_event_appendBulkBad
# 需要導入模塊: from wishbone.event import Event [as 別名]
# 或者: from wishbone.event.Event import appendBulk [as 別名]
def test_event_appendBulkBad():
normal_event = Event()
try:
normal_event.appendBulk(Event())
except Exception:
assert True
else:
assert False
bulk_event = Event(bulk=True)
try:
bulk_event.appendBulk("hello")
except Exception:
assert True
else:
assert False