2
# -*- coding: utf-8 -*-
3
# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
5
###############################################################################
6
# OpenLP - Open Source Lyrics Projection #
7
# --------------------------------------------------------------------------- #
8
# Copyright (c) 2008-2017 OpenLP Developers #
9
# --------------------------------------------------------------------------- #
10
# This program is free software; you can redistribute it and/or modify it #
11
# under the terms of the GNU General Public License as published by the Free #
12
# Software Foundation; version 2 of the License. #
14
# This program is distributed in the hope that it will be useful, but WITHOUT #
15
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or #
16
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for #
19
# You should have received a copy of the GNU General Public License along #
20
# with this program; if not, write to the Free Software Foundation, Inc., 59 #
21
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
22
###############################################################################
29
async with websockets.connect('ws://localhost:4317/poll') as websocket:
32
greeting = await websocket.recv()
33
print("< {}".format(greeting))
35
time.sleep(random.random() * 3)
37
asyncio.get_event_loop().run_until_complete(tester())