示例#1
0
def bar_synchronous(loop, client):
    for i in range(10):
        widget = make_widget_synchronous()
        loop.call_soon_threadsafe(client.append_widget, 'bar', widget)
        loop.call_soon_threadsafe(client.log,
                                  'Made widget {} in another thread'.format(i))
示例#2
0
def bar_synchronous():
    widgets = []
    for i in range(12):
        widget = make_widget_synchronous()
        widgets.append(widget)
    return widgets
示例#3
0
def bar_synchronous(loop, client):
    for i in range(10):
        widget = make_widget_synchronous()
        loop.call_soon_threadsafe(client.append_widget, 'bar', widget)
        loop.call_soon_threadsafe(client.log,
            'Made widget {} in another thread'.format(i))