Beispiel #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))
Beispiel #2
0
def bar_synchronous():
    widgets = []
    for i in range(12):
        widget = make_widget_synchronous()
        widgets.append(widget)
    return widgets
Beispiel #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))