Merken

Better asynchronous code with Tornado and Python 3

Zitierlink des Filmsegments
Embed Code

Automatisierte Medienanalyse

Beta
Erkannte Entitäten
Sprachtranskript
thank you guys and thank you for coming after this body and stuff morning I hope I will not
disappoint you I will try to not make a final sweep of the for 1st couple of words how will we do this today so I have a 40 minute slot basically and so I don't want you to wait till the end of the talk to ask questions please right hand at any point of time I will try to make this interactive so of course I have the microphone so I'm divorced now but you'll get wants you just raise your hands have a nice discussion here so I don't see today about the best interest of developments and tornado in particularly how can we make it better was tool that come with Python 3 1st of all of course it had the question who is this guy and what does he noted presented stuff so I'm just as you would have the pipe and developed and so I work with Python polite 5 years more or less I love it I love it so much that I started the union group that is making workshops in Munich and we're trying to get more people into Python a lot of so my that of course they work with company that is very quite friendly say a couple of words about that to my company school b is the German people subscription services it offers lots of the the books on the monthly subscription based like flat-rate and we have the native apps for Android and IOS and so people like that that's because it would five-star rating so that you know it costs money which is pretty cool of course being user-friendly is nice but it's more important to the developer from so this other than going to presented today is not some abstracts blog posts that I write a week ago this is trans and production for us for years so real thing and basically it comes out of the problems that we have so I'm presenting you the solutions that are already deployed and as I said the company around 5 as the main language we also like very much to participate in Python events share our knowledge is we are sponsoring Europe-wide them and also other Python events in Germany especially and let's move to the challenges that we have from 1 day to another and that's we just do this solution so 1st we have a very distributed systems meaning that would have not just 1 server would have many sources that need to communicate with a network of some mostly to ice so we learnt by time and that's the thing that this synchronously obviously it makes it way more efficient therefore we could not use just a nice and then gender and has the internally that would be not their performance we are trying to build tools that speak to each other seen from and efficient we also on our way to migrate into Python 3 like probably most of you guys have cost is not that easy but some models from . 3 some models still run by consume most of them actually course uh so it's also a bit of a challenge and we see what tools are already usable with Python 3 what tools are not laughter share and this presentation will be basically fully practice-based this is overview 1st I'll speak to guys again why do we need this in front of stuff at all and when doing it the 2nd step How generator of the legations syntax introduced by 3 makes it easier on nicer and then of course they think of this as a tool that we heard already on this conference wonderful talks by the way I'm going to just quickly cover it again in case someone is still missing this information then which is a real framers account that can be usable together with assessing the already at this point in time nature of things ready for production and I'll show you guys a little demo of not just needle also other frameworks how does perform synchronously together what you should do they have compared to each other yes what well I want this to the other recording so it doesn't matter much but again good so why do we need a synchronous communication at all let's have a little recap on the web server execution models like how how the how can it work the 1st originally the idea was to have 1 thread for right this is very straightforward have clients come in with greater threat for its we handle request under threat it's very easy very straight it's very easy to show the memory we have initial obviously OK guys who had seen the further observer died anyone I can so this is not just me which is and that that Aronson obviously should slam the operating system goes out of the memory 1st can do evil things you and the worst is that uh when our system is overloaded not only the new clients will experience a better service but also exist in 1 so the whole thing precious fossil that so what would be the logical step uh to fix this feature well it would obviously be to have a full of on the threat stratospheric that would limit the amount of fat or processes doesn't really matter in this case so by limiting the the threat will will not so and we show our system into the state where it crashed right so we have a fixed number of threats when our system works fine when the it's still
performance and nobody experiences any problems with that but for some new clients that will join 1 hour full is already a fact that will just have to wait and this is that because obviously it even the threat was back does not mean that our system is already out of resources that just means that some number that the peak is reached but we might and we usually do have more resources to handle more clients so the next step was to have been a simple to observe that has just 1 threats but it can turn the picture around the that it upside down because this 1 threat has I will and missile controls what clients get service at which point of time and since usually a server I bound so we are not performing and heavy computation in our web applications most likely so our CPU is pretty OK I memories also predefined we're waiting for something well than for the database waiting for cash waiting for whatever things and so the idea is you can actually decide at which point of time which finds can get services and other kind can just wait for the data to be available on a particular subject and I will in jungle this connection jungle with client and just so yeah process every point the right point of time so it does the event-driven switching in 1 threats but yourself 1st they think is not something you like uh this is not the 1st time of 1st so with the accounts and rises up again so you're right because the native like 6 years old and there is also 2 with true Python tool for the network and I still think it's 1 of the best and there are also suffer in other languages so obviously why still use book service and what's a problem because sequential code is obviously way easier to read it's easier to test it's easier to maintain and extend we have seen how gender was successful how Wright was successful just because of the simplicity and nice vector of course of this things do matter and then obviously with think why can't we just have a synchronous codes to be structured and written in the way that it can be just threw the ball as seen from the skull looks similar without the kullback Helen stuff and by found 3 let left of the this is something that I'm going to presented today this is just a little piece obviously you're most likely already seen it but still this you from is the generator of subdelegation syntax introduced and pattern and so it lets us write the assumed promise growth-enhancing from most fashion again I'll have this more detail in the latent so now yield from its aims to replace Kullback but 1st we need to counter decision what's so bad about the kullback like it's something pretty common it's so interested in stages and just cliffs of course it is difficult to make it look like that any 1 of you guys work with JavaScript yeah obviously obviously itself the the guys the this I also the jealous cube and they see this is the real problem decide is some testing thing of course but still I mean even for testing I usually try to work with and but but later the nice resource called held gone that if there is such dominant is that I assume with we're clear that we might want to what call back so sequential code obviously looks nice and by introducing new from in Python 3 we have this attempts to right something from everyday basis results called that help now it's time for a good example so we have a very simple function let's say together handler or whatever with framework now we have a huge database query with this blocking obviously the result of a query it is saved as a result variable and then we write this stuff back to the user this is looking at how would you do it
was called back so was called X we can define an a function this method or anywhere that will be a callback that will be passed as an argument the huge database queries and the huge database query will call its well and the result is that also critically right this is not as bad as an example disastrous of course because this is it's not defined in line but still we can make it even
better was the sub generated based on so we put you from just before the huge database square and co-author guys use this encoded so that OK so that I know I stop a bit on this then so what exactly does you from do here so if use database query in this example should not return the result so it should not block it should determine the future this is the magic objects I'll speak about that in a moment but this magic object is sort of like a promise that variable real result will come at a later point and we use this future back to our work or into our ideal that will at this point switch to any other task with it has and whenever the results of the future is ready whenever future can be related to the result it will push it back to this point as if you can imagine as you from would never be the match it will be safe to results and written that the client so what is exactly magic behind it and what they think are just for this so as it was already told a lot on this conference in this most of the event and a set of tools to use this event efficient mental can reduce the kullback for any particular and book particularly event let's say most typical case of course we want to get the facts some network resources so we need to make the TCP connection and then we just wait so without viable halo when the data will be ready on this sockets please call this function and that's that's in advance what what do we need to know about In this example I have a minimal set up how can we call it so we have all the function will be required and it doesn't affect anything it will just be called as soon as possible but 1st we need to get the event's loop instance then we get the Kullback Michael also in the school at any point of time when you can and then we started out that said minimal examples so Nolde factionalism that not now to get more familiar with this thing which took a bit about the future of what exactly does do so those of you with this who worked with JavaScript probably know all the deferred a promise objects most likely so this is a very similar thing so this is some object that acts as a reference to the results we have the subject just to check state of the of the operations that we want to perform let's say we want to buy the database query we call that query and the future object is just the returns to keep a reference to the result that is not ready yet but will be right at some point of time or it will fail so we have the teacher to keep the reference to something that will be available at a later point of time so the simplest way to run the future is just to you this run until complete on the idea of entering the future result but this is the usual personal the case that we want we want a nice so then we need to to have a better syntax we can also yielded like here so we define a quality and it's also important to model whatever web framework you're using a has to know that you're using coroutines otherwise the just generated so we are searching for example will will call the results will be a future then we use this future does fetching and saves the results vectors the result variable then the print and of course to make this whole thing right we need to runs so what about tonight here tornado is a web framework that is already there for 6 years it has on all viable has formed futures but now it has to be obviously compatible with the same period because this is a common frameworks that all the Python higher-level libraries should use so they turn it is already production already framework and so its compatibility with the the video is already there basically this is a step how in the best case in the future we will see them divide the world on the application framework level we can have enabled use that both of our other framework then this and Ireland I think should be used and finally facing the audience at the end of the common interface for the operating-system-specific select slight AQE ball or window select without this is how should it be right now now even if you use Python to and you can use the tornado with only events With on futures is on average but since we want to develop for the future we want to be future compatible we can use
this fears about so let's look at the event and how does it work was turn it on its compatibility with the single In this is 1st the way that you would get there on the internet just select a car and it's a singleton you started this is the way that you can use to enable was thinking about basically again this is the same 2 lines of code was just different syntax With these replace 1 with another you're running a promising futures again during his own futures thinking has on future but they're overlap and current features but from Python to also produce similar things but for with compatibility we need to use that tornado magic methods that will convert 1 type of Future Internet of the future which is not a big deal because again in just 1 line of code knowledge think it's a good time that we have a full gets handler region tornado well let's look at this so interrelated so we need to inherit from their request and then we need to mark the method as a quality and so that the reader knows that the thing that we will be using is the future and the future should be evaluated and then the results of the past that we need to instantiate the asynchronous HTTP client that will not just block instead of worked on future construct them and return it for us then we use the facts methods to find some really slow API whatever you in the future is that is will return back that I will I will I will call us back at the right point of time when the result is available and they have the response here alternatively of course there may be no result there may be a time of there maybe for oral or whatever then it will be just normal Python exception handling so in this case and that will just right for 4 http and that's it you catch was normal tri-accept then we write response back to the user it's pretty common for Python web framework and then we need to call cellblock finished because this is security and so we want to keep control When request got this is a full example let's say that we want to make the HTTP proxy we we want to pass the euro as a parameter and we want to Toronto was thinking about fetch for us and just last unit vectors acquired so these are all the required as imports there's not that much actually this you have already seen the way that we construct request handler images get the euro arguments from get parameters we begin to read these distincition declines we this URL you in the future so that I will get a response back right response finish response yeah with the question the yeah it you yeah of yeah you think of it very well so I repeat the question the question is how exactly does it work over here that HTTP clients would normally blocks when you call the fast weights for the resource to to be fast and so you know what what is this you from doing in this place uh well how does asynchronous magic word very good so this is a kind of a spatially sticky clients extinguished if the client obviously so we have a similar uh library called just HTTP client international and it will do exactly the same if you run into the people and the effect it would block it so the weight just like request just like your Elliott it would block and weights and for the response a scene which is that the client is not looking it's not
waiting it quickly construct a future object so not the real response object future object and returns that and since we do not need to wait for long time just build the future it's basically just creating an object of class if this happens super fast and then we used in this future so
we're sort of say sending out of the function back that I will that is controlling this whole process meanwhile yes this get request will just so it's like frozen in the states until we have the response of the French thing but they have other plans meanwhile so I will I will In the meanwhile will serve other connections for us therefore this gets handler will be posted but others get service and see in practice it happened so fast that you never see and whenever I will you will notice that came out the URL is texts now we have based on our sockets it will propagate who have been waiting for it all it was this proxy get things and this will go that and like it back if you will had the result with respect and it will push it just over here so you can imagine that after is I will was done with such stuff imagine that yields from was gone it was never there there was just the such operation this is basically in a glance how that will work that was and since it stopping anyway and yield from uh why do you need a few future objects quite a few children futures markets so why do we need the future of here so 1st of all you from all there was always yield results from high yield from is required if we want to get futures from another qualities in this case you don't have to use you probably can also use just yields but if you're building a big system you might have a stack of the proteins so 1 calling chapter 1 calling another then you need from but this is a guest not the question the the question is why do we need future at all at this point so we need the future because if we return after the French call if we will return the result we obviously need to wait for for results here so basically this call will block so since inspection takes a long time we construct a future and constructing a future does not take long time because of just creation of future object without making this is basically how we use features it's kind of abstraction that lets us not to wait for the response but to give something back so that color has a reference to the response that will come at a later point time and if you might find confusing this cue from synthetic you can also imagine they're all future so if we take that take away you from just to get the future and doesn't don't call response colleges future they yield from away then at a later point of time get response I broke so to to
get the response of this thing it's a little later point time
we can just call future don't results there and the eventual give you the results it's right so future is pretty simple it has a status as a result it has an error guess so you can access to the results directly but this just my so if you don't do it sends you let's that I will do it because then you can use the magic from syntax that will extract the results out of the future for you the this is the you hear all all know there will be no resulting you can also check the result is a so if you want to write a really bad quality you can write a little in which you would ask if the involved there all the the result that and then you will remain valuable because think that that's what is responsible for OK so we have this example as far as I know so let's go further the most
have the IPython notebook for you to show this thing running let's agree on the simple case of we're going to test so we have declined that will be all right now we have a web server this will be the whatever's framework where test and then we have 3 API this 3 API so will be requested in Paris and so so as seen from and so we want to check how well server is this 3 concurrent requests for this party to assimilate this whole
thing was external dependencies that have everything running on my laptop i have tornado server or frame of servitude and have done local server that just weights for a fixed time out of 10 ms on every request and returns a dummy Hello world and you can see it over here so this is what my dominate local server us now we can test how fast can IPython Notebook effect this dummy server responds directly so that we have
something to compare 2 so it's 60 ms from the 16 ms than MS is our thinks of doing that we have purpose and 60 ms for fractional so 1st example we have just look inside just a block Internet the server that is used initially the people and not facing Fisher that the client therefore it does not return futures it blocks and it waits for results In this list comprehension I have 3 urals redone Urals but that's what I want to calling fetch on each of them and then I'm just so will be no responses and right handed back to the user this is how it will work so we request the 3 times saying own we have the response let's see how that goes OK so this is the the 4 ms altogether obviously we just multiply the 16 by 3 because of the book and so so it didn't sequentially now let's see how the same thing but just use and the basing it should be applied for basically what do we need to do to convert looking courts to non-blocking calls we need to change the features of client interlacing visited required so at this thing then we need to market as a quarantine in order to let's say tornado or other framework in ICT 0 it'll be also protein the crater but we'll let it know all that this thing that is the news will you must make the future so that the reader knows the process at the core so we
calling this thing we have the same response and this should be
3 times steps it's not because of the overhead of course this whole thing I will open stuff has on overhead but it's 22 milliseconds so compared to 54 2 and a half times less more less and comparing to the requesting a dummy mural directly 16 versus 22 we have again about 5 nanoseconds little ahead of time now the fun part comes knowledge so this is also missing from the framework and probably everyone has already been on the internet some article I claim knowledge yes on the EC 2 micro instances handling and then hundred thousands of connections simultaneously yes this is so this doesn't work especially in the case of WebSockets is is the perfect place synchronous framework to be used because for WebSockets how many connections but all of them are mostly I so we are wasting our CPU would have resources dedicated to each of these connections are the ones who to use all resources efficiently therefore at 1 point of time we can have just 1 clients getting real work done on the back and others can just wait because let's look at some of everyone to do stuff at the same time so this is how it works I might of course have it's not so they're not in the perfect way as some just who ruled the device me but I did that on purpose because they try to avoid external dependencies but not just has a lot of external libraries that would make it kind of looks nicer but this is just a few remote the so what we do here and they created their options object that the keeps reference to the local local host dummy around I have the arrays that is waiting for responses that will get the responses then I need to look I'm looping over at the icon which is 3 just that have to request and they do it should be that gets slower GDP is a library
that this kind of that is engaged with the client International and then I need to of course the final back what to do after we fetch stuff and then define it in line in the best traditional the don't need to 2nd coding I need to create a body chance because this function will be called small the result is read it but when the charter rights so on the data creating another in 1 function that will push this challenge because there a chunks then on the ends the events that will send us after all chunks of their I need to go with that together using in proper context then I push responses so the body of objects and finally when they see this OK so responses are so we just as the the icons that was reinstated the everything is right now and then I create a response that place that had the and that's it I and requests again we have the same
thing in with the that this works begin remind what was an international meanwhile so because those 22 milliseconds for and it's a simple knowledge this brown objects well done they have 3 ms faster but maybe hours more power developer or let's have another example scholar wonderful performance language I guess I just don't have time to go through all of this believe me you don't want to read I of course I realize that the people who are experts and scholars do this with the best in fact I was not the guy who were all this because on every conference on insurance some company examples I ask someone you know or some other thing from the framework to give me the example so that they can edit into my comparison but the funny thing is that this thing is that performance let's see how in practice of course vendors who turn it 18 90 and slightly more than not but of course this is not a very fair comparison because I have a fixed number of moles of of bacon API which is free so I fetch 3 guys what if we have that what it would have to enter we don't need to speculate I wrote a little benchmark that will and this question so here I have tornado I have no and I have and will and I'm going to increase the number of concurrent requests from 1 to 20 then I'm going to plot a graph that will show us how do these different things they have on the increase in laws so on the increasing number of concurrent requests and now it's ready so here you see tonight I was looking at the beginning but the this quite stable at least we see that a little bit of question was not GS because somehow it's 5 requests just blocks and jumps up and in case of Scotland the logo it's 1st of I have nothing to add here Roberts scholar turn also did a good job and so I have a feeling that the I might just have not the perfect configuration for knowledge because it will be the the the spectrum of jumping on profile following request so I think that's where we can stop at this point let me then jump back to my slides this event I will be open for my questions in the 2nd just before it is this I want to remind you once again that if you want to do this cool stuff have time for experiments and so on you should maybe go to school because the URIs could be built the s and check for the job then I will be happy to know that my presentation will work to somebody else continue with this research at some different topics so guys take it again Scooby use jobs and thank you very much for your and few
now questions OK for the top and I was interested in since the Chicago International have very similar jobs where is the elements of doing and they don't talk it's so I just this OK good question so why do we need to unintelligible placing it at all so I think we'll does have a higher level libraries to it's not only that I will futurists it also has tools developed specifically policy already and that these so this inclusive decline between at least some database drivers of reading books of turning is a web framework so you can imagine tornado as a subset of gender it gives you can place it gives you a base class request and the user basic security stuff like CSR protection and so on who can handling and stuff and assessing the or I can go back to that life where I had this step and
yet this yes here thank you filtering is at a higher level its application framework that lets you build the web applications fast can be
synchronous and estimate from a single source is just 1 of the options that you would use to most likely you will do it because you
can but you don't have to and I think is a common middleware so to say being higher-level frameworks like turning worked with that and lower-level operating system selects like he Curie polar selection windows so this is kind of a lower level set of tools and yes you can use it to directly with alternating but that you will need to build the rest of the Web that yourself and this is something that you would normally want to avoid you yeah exactly you can also called World the low levels of the the next question yeah I'm not really familiar with this framework of summer question is is there a built in order and if the answer is don't use there is a forum of choice like preferred 1 or the 1 that you use and then search and the actual question is there to help them as a sink stuff works with warrants OK very good so 1st what do we have the international now and full of question what would be the the preference will guys I was working with gender for quite some time and I love the simplicity but birds that I've also seen attempts to put of SQL the gender work which is fine so I think that the skeleton is kind of the standard around for Python in general and this is also our choice to be to use that information to there is nothing special interconnect tornado to a skill or it's just 2 totally different things that are easy to use together but you don't have to use them together in fact in some websites you don't need that is so actually do not have an overhead of the arm is even better sometimes but if you like to have a database selectable the traditional of websites 3 tire set up I would recommend it to yourself and it's with the flexible and nice but out but generally you're not limited by that you can use any or as you like and there was this thing the 2nd other parts how does it work with the same yes so I'll stands for that you have a right in asking this question because having missing from most of execution on the web server level does not guarantee us successful obviously it's something that's year of waiting for like a database or a cash does not support the synchronous request again things this problem by having that thread pool and use ThreadPoolExecutor which is a and Python but this is not cool obviously because end up with a flexible and that what we wanted to avoid the 1st place but now was a think your we're having more and more tools and get support for instance for the database you most likely like was just because everyone likes progress the have cycle is used to drivers that supports the synchronous mold for we also have the synchronous driver from 1 go we have I'm ongoing think so most of the tools already color but not all of them so you need to to really look but now since we have this common interface that seem very they will grow that's for sure wrote in your which the time of the nation's future within the country fj hypersynchronous
Demo <Programm>
Bit
Punkt
Sweep-Algorithmus
Gemeinsamer Speicher
Natürliche Zahl
Formale Sprache
Gruppenkeim
Synchronisierung
Computeranimation
Metropolitan area network
Client
Web Services
Code
Vorlesung/Konferenz
Web Services
App <Programm>
Softwareentwickler
Datennetz
Pay-TV
Abstraktionsebene
Humanoider Roboter
Quellcode
Ein-Ausgabe
Biprodukt
Ereignishorizont
Software
Rechter Winkel
Festspeicher
Server
Information
Aggregatzustand
Server
Zahlenbereich
Kombinatorische Gruppentheorie
Framework <Informatik>
W3C-Standard
Physikalisches System
Datensatz
Informationsmodellierung
Benutzerbeteiligung
Netzbetriebssystem
Luenberger-Beobachter
Thread
Softwareentwickler
Demo <Programm>
Physikalisches System
Wort <Informatik>
Bitrate
Resultante
Server
Maschinencode
Folge <Mathematik>
Prozess <Physik>
Punkt
Dokumentenserver
Formale Sprache
Web-Applikation
Datenbank
Regulärer Ausdruck
Zahlenbereich
NP-hartes Problem
Computerunterstütztes Verfahren
Zentraleinheit
Framework <Informatik>
Code
Computeranimation
W3C-Standard
Metropolitan area network
Variable
Client
Web Services
Code
Ereignishorizont
Gerade
Hilfesystem
Einfach zusammenhängender Raum
Softwaretest
Parametersystem
Lineares Funktional
Datennetz
Datenhaltung
Abfrage
Vektorraum
Physikalisches System
Entscheidungstheorie
Zustandsdichte
Geschlecht <Mathematik>
Rechter Winkel
Würfel
Festspeicher
Basisvektor
Gamecontroller
Server
Resultante
Bit
Punkt
Momentenproblem
Browser
Hochdruck
Datenbank
Kartesische Koordinaten
Extrempunkt
Computeranimation
Übergang
Videokonferenz
Internetworking
Metropolitan area network
Client
Einheit <Mathematik>
Trennschärfe <Statistik>
Bildschirmfenster
Große Vereinheitlichung
Gerade
Schnittstelle
Parametersystem
Lineares Funktional
Nichtlinearer Operator
Vervollständigung <Mathematik>
Datennetz
Datenhaltung
Abfrage
Systemaufruf
Ähnlichkeitsgeometrie
Strömungsrichtung
Ideal <Mathematik>
Ausnahmebehandlung
p-Block
Biprodukt
Frequenz
Ereignishorizont
Menge
Analog-Digital-Umsetzer
Rechter Winkel
Client
URL
Ext-Funktor
Instantiierung
Aggregatzustand
Proxy Server
Gewicht <Mathematik>
Hyperbelverfahren
Code
Framework <Informatik>
W3C-Standard
Task
Demoszene <Programmierung>
Loop
Benutzerbeteiligung
Task
Proxy Server
Koroutine
Endogene Variable
Datentyp
Programmbibliothek
Ereignishorizont
Bildgebendes Verfahren
Einfach zusammenhängender Raum
Soundverarbeitung
Matching <Graphentheorie>
Vektorraum
Endogene Variable
Keller <Informatik>
Portscanner
Objekt <Kategorie>
Quadratzahl
Zustandsdichte
Loop
Gamecontroller
Wort <Informatik>
Normalvektor
Einfach zusammenhängender Raum
Resultante
Proxy Server
Nichtlinearer Operator
Lineares Funktional
Punkt
Prozess <Physik>
Hyperbelverfahren
Abstraktionsebene
Anwendungsspezifischer Prozessor
Gebäude <Mathematik>
Klasse <Mathematik>
Automatische Handlungsplanung
Systemaufruf
Physikalisches System
Socket-Schnittstelle
Quick-Sort
Computeranimation
Objekt <Kategorie>
Metropolitan area network
Web Services
Reelle Zahl
Proxy Server
Endogene Variable
Vorlesung/Konferenz
Kantenfärbung
Cloud Computing
Aggregatzustand
Resultante
Punkt
Zustandsdichte
Hyperbelverfahren
Endogene Variable
Client
Computeranimation
Endogene Variable
Fehlermeldung
Kernel <Informatik>
Server
Gewicht <Mathematik>
Gerichteter Graph
Rahmenproblem
VIC 20
Maßerweiterung
Framework <Informatik>
Computeranimation
Metropolitan area network
Benutzerbeteiligung
Interaktives Fernsehen
Notebook-Computer
Code
Total <Mathematik>
Normalvektor
Soundverarbeitung
Softwaretest
Inklusion <Mathematik>
Elektronischer Datenaustausch
Mixed Reality
Systemaufruf
Kreisbogen
Client
Server
Ext-Funktor
Resultante
Kernel <Informatik>
Server
Prozess <Physik>
VIC 20
Extrempunkt
Framework <Informatik>
Computeranimation
Internetworking
Metropolitan area network
Last
Client
Code
Endogene Variable
Parallele Schnittstelle
Anwendungsspezifischer Prozessor
Systemaufruf
Elektronischer Datenaustausch
Mathematisierung
Mailing-Liste
p-Block
Systemaufruf
Gruppenoperation
Endogene Variable
Loop
ATM
Server
Speicherabzug
Ordnung <Mathematik>
Ext-Funktor
Resultante
Server
Konfiguration <Informatik>
Punkt
VIC 20
Regulärer Ausdruck
Zentraleinheit
Framework <Informatik>
Synchronisierung
Computeranimation
Eins
Internetworking
Metropolitan area network
Client
Perfekte Gruppe
Code
Verweildauer
Endogene Variable
Programmbibliothek
Gerade
Normalvektor
Array <Informatik>
Einfach zusammenhängender Raum
Lineares Funktional
Datentyp
Elektronische Publikation
Stellenring
Varianz
Elektronischer Datenaustausch
Bildschirmsymbol
Kontextbezogenes System
Systemaufruf
Ereignishorizont
Endogene Variable
Konfiguration <Informatik>
Objekt <Kategorie>
Suite <Programmpaket>
Zustandsdichte
Loop
Rechter Winkel
ATM
Mereologie
Reelle Zahl
Overhead <Kommunikationstechnik>
Ext-Funktor
Logik höherer Stufe
Instantiierung
Server
Bit
Punkt
Datenparallelität
Formale Sprache
Zahlenbereich
Element <Mathematik>
Kombinatorische Gruppentheorie
Gesetz <Physik>
Punktspektrum
Framework <Informatik>
Computeranimation
Übergang
Metropolitan area network
Benutzerbeteiligung
Perfekte Gruppe
Prozess <Informatik>
Proxy Server
Programmbibliothek
Vererbungshierarchie
Vorlesung/Konferenz
Plot <Graphische Darstellung>
Softwareentwickler
Konfigurationsraum
Parallele Schnittstelle
Leistung <Physik>
Benchmark
Videospiel
Expertensystem
Graph
Computersicherheit
Datenhaltung
Varianz
Profil <Aerodynamik>
p-Block
Paarvergleich
Ereignishorizont
Teilmenge
Rechenschieber
Objekt <Kategorie>
Druckertreiber
Geschlecht <Mathematik>
ATM
Client
Web Site
Web-Applikation
NP-hartes Problem
Kartesische Koordinaten
Gerichteter Graph
Framework <Informatik>
Computeranimation
Übergang
Metropolitan area network
Skeleton <Programmierung>
Benutzerbeteiligung
Webforum
Arithmetische Folge
Code
Trennschärfe <Statistik>
Netzbetriebssystem
Bildschirmfenster
Vorlesung/Konferenz
Thread
Ereignishorizont
Auswahlaxiom
Schnittstelle
Schätzwert
Datenhaltung
Quellcode
Keller <Informatik>
Konfiguration <Informatik>
Middleware
Druckertreiber
Menge
Polarisation
Rechter Winkel
Geschlecht <Mathematik>
Mereologie
Dreiecksfreier Graph
Server
Information
Overhead <Kommunikationstechnik>
Instantiierung

Metadaten

Formale Metadaten

Titel Better asynchronous code with Tornado and Python 3
Serientitel EuroPython 2015
Teil 39
Anzahl der Teile 173
Autor Caceres, Anton
Lizenz CC-Namensnennung - keine kommerzielle Nutzung - Weitergabe unter gleichen Bedingungen 3.0 Unported:
Sie dürfen das Werk bzw. den Inhalt zu jedem legalen und nicht-kommerziellen Zweck nutzen, verändern und in unveränderter oder veränderter Form vervielfältigen, verbreiten und öffentlich zugänglich machen, sofern Sie den Namen des Autors/Rechteinhabers in der von ihm festgelegten Weise nennen und das Werk bzw. diesen Inhalt auch in veränderter Form nur unter den Bedingungen dieser Lizenz weitergeben
DOI 10.5446/20082
Herausgeber EuroPython
Erscheinungsjahr 2015
Sprache Englisch
Produktionsort Bilbao, Euskadi, Spain

Inhaltliche Metadaten

Fachgebiet Informatik
Abstract Anton Caceres - Better asynchronous code with Tornado and Python 3 The asyncio module introduced in Python 3.4 is a game-changer for I/O management and event-driven network programming in Python. Aiming to be a lower-level implementation of an asynchronous event loop, it intends that higher level frameworks like Tornado, Twisted or Gevent will build on top of it, taking advantage of the shared interface for writing concurrent event-driven code across different Python frameworks. This talk connects theory with practice, presenting how Tornado can run in the asyncio event loop and take advantage of the subgenerator delegation syntax (yield from) to provide a high degree of concurrency while keeping the simplicity of sequential code. It explains the concept of coroutines, futures and ioloop, exposing Python 3 code for sample web tasks. The talk completes with a basic demo of running this code on Tornado, comparing its syntax and performance with popular asynchronous frameworks from other languages.
Schlagwörter EuroPython Conference
EP 2015
EuroPython 2015

Ähnliche Filme

Loading...