has a Global Interpreter Lock (GIL) • It limits thread performance • It can be unpredictable 1 >>> import that 2 The Unwritten Rules of Python 3 1. You do not talk about the GIL. 4 2. You do NOT talk about the GIL. 5 3. Don't even mention the GIL. No seriously.
interpreter lock" • The GIL ensures that only one thread runs in the interpreter at once • Simplifies many low-level details (memory management, shot yourself into leg etc.)
= asyncio.get_event_loop() while True: # getting title from ice cast server title = \ loop.run_until_complete(get_current_song(host, port)) if title: # connect to redis redis = \ loop.run_until_complete( create_redis(('localhost', 6379)) ) # and put song title into redis loop.run_until_complete( redis.publish('CHANNEL', json.dumps(title))) loop.close() return False
framework with black jack and so on • React - V layer • with Angular you have all for SPA apps • Angular 2 is more about TS • with React you have large ecosystem of libraries that give flexibility
eventSource var eventSource = new EventSource(“/api/track_stream"); eventSource.addEventListener("track_update",function(event){ // if u use jQuery just get song from event and put into tag $('.current-song').text(event.data); }); eventSource.onerror = function(event){ // oops console.log(event); }