当前位置: 首页>>代码示例>>Python>>正文


Python Sender.queue方法代码示例

本文整理汇总了Python中sender.Sender.queue方法的典型用法代码示例。如果您正苦于以下问题:Python Sender.queue方法的具体用法?Python Sender.queue怎么用?Python Sender.queue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在sender.Sender的用法示例。


在下文中一共展示了Sender.queue方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: main

# 需要导入模块: from sender import Sender [as 别名]
# 或者: from sender.Sender import queue [as 别名]
def main():
    global indexer, uploader, sender, receiver, downloader
    setup_signals()
    logging.info("Asink client started at %s" %
                 (time.strftime("%a, %d %b %Y %X GMT", time.gmtime())))

    #create all threads which will be used to process events
    indexer = Indexer()
    uploader = Uploader()
    sender = Sender()
    receiver = Receiver()
    downloader = Downloader()

    #create and set up queues which are used to pass events between threads
    uploader_queue = Queue()
    indexer.uploader_queue = uploader_queue
    uploader.queue = uploader_queue
    #set on watcher when initialized

    sender_queue = Queue()
    uploader.sender_queue = sender_queue
    sender.queue = sender_queue

    downloader_queue = Queue()
    receiver.downloader_queue = downloader_queue
    downloader.queue = downloader_queue

    #setup storage provider
    storage = setup_storage()
    uploader.storage = storage.clone()
    downloader.storage = storage

    #start all threads
    watcher.start_watching(uploader_queue)
    indexer.start()
    uploader.start()
    sender.start()
    receiver.start()
    downloader.start()

    #sleep until signaled, which will call sig_handler
    while True:
        time.sleep(86400) #= 24 hours just for fun
开发者ID:OmniPi,项目名称:asink,代码行数:45,代码来源:client.py


注:本文中的sender.Sender.queue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。