KotlinConf 2017 - Introduction to Coroutines by Roman Elizarov

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] hello everybody look at you what a crowd here I hope you're all seriously interested to learn about car teens and not here just because they have nothing else to do so let's let's get started my name is tama leao's arf I work on cotton libraries in general and everything around curtains in particular and in this talk I'll introduce you into the world of cartoons which is pretty new I'd say or all the same time let's talk at first about asynchronous programming so why we do it what it is you see the world we're now living in is connected the systems were built nowadays don't really do a lot of computation most of the time the systems were built they communicating they communicate between themselves front end system communicates with backends Bekins community to communicate between themselves and we're living really building systems that wait most of the time nowadays they don't really compute they just wait they send a request a server where the answer send a request to another way to answer that's the more than walls we're living in microservices arrests api's that's the bread and butter of our life so how do we write this code what our solutions we have to write in the code like that trust this question we'll consider really simple joy problem that you might have encountered in your life let's say we have our some messaging application to do that does whatever pass on blog and something like this and in order to do something like post something we need a token for submission so we request it first and we have a function that waits for awhile and then returns us talking then we have another function they would use this talking to make the actual post and again it waits and returns after a while and then we do some post-processing maybe we want to save it to cache update UI or do something like that so writing the code that does all the strips is easy right we just request Duncan create post-process buzz that's how it is just one two three so of course we can be sold into a threat and we'll be doing this for lots of times threats has been the solution to the problem with waiting that we've been using successfully for for many many years but is there's a problem with threats or and if we are sold News with threats we all our weighting functions will be blocking the threat and that that's what happens when we well resolved with threats I mean is it okay not blocking this res but it depends and you only transfer this question let's think about how many threats we can have in our application so if our application has 100 fans that's okay I mean even any phone nowadays can handle hundreds you know you don't need to have a really high-end system to do it a thousand threats okay I mean that's more complicated but still still possible 10,000 threats determine that's a challenge threats typically occupy around two megabytes of memory or something of that order so tense I wasn't stressed like 20 G's remember already I mean you'll need some really high-end system to support that but it's still possible 100,000 stress I don't think that's realistic the problem though the systems are writing nowadays they do call for lots of lots of activities again they wait most of the time so I we have plenty of CPU and like some back-end system handling hundred thousand activities at the same time has its hundred thousand connections or hundred thousands anything is not doesn't seem that big we should be able to do it so solution that's been helping us for quite a while yeah our callbacks how do we solve this problem with callbacks instead of using this simple function they just returns the result and it looks naturally we turn it in - in a synchronous function that takes a callback sis's parameter and instead of returning results it actually turns immediately and then when the result is ready invokes the callback with the result so we did the same transformation with every function we have the vagrant and that has to be invoked asynchronously we also convert the result into callback and then our simple 1-2-3 procedure turns into something like this right so we have instead of just writing it in simple linear way that represents the logic of our application we write this callback in and you know this closing brace they tell a lot they're also known as called the hell and if you should go google call the hell you'll find examples which are much worse where the whole screens of closing braces there and what's called Lex there's no much nothing else you can do like the more steps you have in your application the more it intention you have in your code and the more closing braces you have that's like with skull bags but they do solve the problem of synchronous programming like the bread and butter has been for quite a while grandfather of nodejs programming and in in genuine JavaScript frameworks so it is the solution just not not a pretty one so also this code is simplified I mean in reality when you work with callbacks you have to handle exception somehow and you won't happen automatically like you will have to make sure the exceptions get propagated or handled so the actual code is more complicated than I have shown here so I've really shown something simplified so the next solution that kind of saves us from the kaabah hell are is called futures or promises or airex it's it's the same name the different name for the same concept the console has been around for a while it's the concepts itself is as all this programming languages or calls themselves and it has lots of different names but the idea is the same instead of taking a parameter that will be invoked later when the result is available we wrap our result into some kind of a promise object of future object or deferred object whatever you name it it's the same concept the idea is we wrap it into something and again just as we'll call backs function returns immediately and at some later point in time the promise will be fulfilled or completed or whatever it is name doesn't really matter the concept is the same so we do the same transformation with every other function we have and now we don't have this call the hill anymore we have the code like this it's much nicer code because it's composable and it also automatically propagates our exceptions so this is the actual code only the code with goblins I have shown you which not the actual code this is this one the actual codes and if for example request token fails the whole operation fails so I mean it's like it's it's really like complete solution to our problem and it also you see there's no necessary indentation anymore so even if I have a 10 step process to code I still code it on the same annotation level the problems with approach though is that you have all those combinators in here in even in this simple example I use then composes in a steps which is actual names of combinators that I defined in Java for completable future in a different and there are lots of different future libraries out there and each one of them names those can combine interests in different name you know then may have flatmap anything and even for a simple code I have to use at least 2 but if I'm to handle exceptions myself or if I if I'm to doing new loops or something that's then I will have to learn more and more of those combinators and for every future library I use I will have to remember different combinators and it's a safe learning completely different programming language just a program on my synchronous code so it is a solution that is better than convex but it's not in the ideal solution we're looking for so that's where cutting carotenes comes risking so-called curtains out there to help right hassles code in a natural way so let's see how it works so instead of embellishing our result with some type like a promise or future what we do is we mark our function with a new modifier call suspend and we the rest of this signature just looks natural so suspend is our indication that this is function is a synchronous it won't return immediately it will suspend for a while and the N will return the actual result later on but the rest of the signature looks natural no embellishing of result and no additional callback parameters it just as you would have written in the regular code so we do the same with the rest of our synchronous function they become natural and our code there was based on combinators when we had futures turns to this as you see all we have to do here is we have to write code just like we usually do but mark the function with suspend modifier that's it the rest of it looks like the regular code that we would have written using thread and blocking the stress which as we saw wouldn't you will scale to handle lots of a synchronous activities at the same time and you see the beauty of that is that when you're actually writing this in ID the suspension points which are not obvious in code anymore they used to be obvious like whose callback like it's painfully obvious where you suspend because you have to pass a callback with futures it's also painfully obvious where you suspend because every suspension point in your code is yet another Combinator to invoke with carotenes it just looks natural your code but sometimes we want to know where the suspensions are so that's where ID helps us and hopefully you know on the gutter shows us what are the actual suspension points in our code which are the calls which are actually going to suspend the execution and will return us out later there are lots of adventures in using this approach and we have a lots of bonuses for example you can use regular loops with such many functions you don't have to learn any special Combinator's or write a messy code with callbacks to loop you can handle exceptions in Rio away with a try-catch even though you want you wanna really see try catching the idiomatic calling code because like in Catalan Holland has a lots of higher-order functions so like usual you abstract away your exception humming into something more higher-order and you would only write try-catch in some library but still yuqian and you can use all the regular higher-order functions that cotton stable standard library provides like for example you can do for each on a collection and then do some activity in no need to remember Combinator that does this you use your regular knowledge of your coding and everything else let apply repeat filter and cetera et cetera all the combinators that are there in the standard library all the higher-order functions that makes your code so consigns beautiful and functional are available for suspending functions just as well and the general pattern here that you shouldn't start noticing by now is everything you do with curtains is just like in regular bulletin code but it's not actually blocking your thread you are actually writing a synchronous code that would scale now let's talk more about suspending functions what are they where they come from you see in the world of the GBM programming for example or even JavaScript your native code in syllabus we don't have suspended functions suspending function with this train many fire is a purely caught in concept in JVM for example you will have a synchronous interfaces defined something like that for example if you're calling some rest service aware retro feed you would have some function that returns you a call again you invoke it it returns immediately and the color object is actually just another future that you know promises to deliver your result at some later time so that's how you usually do a synchrony in your normal code in order to use this with cotton curtains we need to wrap it into suspending function and we do it just by creating a helper function so we will mark it as suspend modifier and we give it a natural signature so instead of returning in future it just returns the object we're expecting but this suspend whatever tells us that we want to return it immediately will actually suspend execution for a while and when it's available we'll return this result and we do this simply we use an extension function that's called a way by convention from some kind of an integration library so for every kind of future out there we will have some kind of integration lab where they define the function that we've decided to call a weight just so it's easy to remember that would actually a weight for this future to complete or fulfill whatever you name it and we'll return you're in the result later on so that's how you start with the spending function just by using integration libraries to get into the world or suspending function and then you code the wages we saw so will this or sequential composition right so you can invoke multiple suspending functions and sequence just off like you do a regular code but what if you need to solve something more complex like here is an invocation to create a post which is suspending as mark on the gardener indicates but what if I need to retry this invocation until it's successful what if I don't ever exception I want just wait a little bit exponential cuisine at the time and which wine how do I do this you know if I'm using like future libraries like Eric's for example they give me ready to use combinators again I have to remember but they're there you know that would let me do this retry when what if I need some complex or custom logic how do i implement this again you might have noticed the partner but when you have a problem skirtings you solve it the same way as you would have solve it in the regular code in this case I would ride a higher-order function that does a return for me so my code looks like this the only missing piece is what's there the finish on this Rio Rancho how they are righted the wait you already destroyed forward all this dissected I need a function let's market with suspend modifier because well invoking you fire or will suspend my execution until the result is finally available but the trick is that it won't accept a regular lambda as I do his regular higher-order function will accept a lambda a functional type that is marked with the same suspend keyword and that is the key trick here so by marking my block that will receive in this route whereas suspend I'm able to use to write a synchronous code with it and the rest of it is just simple whatever logic is i have delay in exponential increase limiting the amount of time I wait I can just write directly and inside of it I can use either the block of code that has been passed to this high order function or I can use library functions like delay that waits me helps me wait in non blocking fashion first order I'm out of time our next topic are curtain builders so we've been talking about disciplining functions and writing code but so let's revisit it a bit I've shown you this piece of code where post item did one two three step procedure was marketed with suspend but what if I remove this has been my defer what if I write it like this if I try to compile this code or even type in an ID I get an error here request token will get highlighted and it will say you know that request document should be called only from carotene or another suspending function I mean why that if you think about that that's logical because you see your request token is marked with suspend modifier so it is a function that has this additional super power it can suspend my execution until the result is available but post item is a regular function it's not marked with this memory so it doesn't possess this super power and I cannot simply invoke a suspended function from regular you know there's simply no way so what do I do how do I enter from my irregular world to this new suspending world we do this through the functions that we called curtain Builder and one of them is called lunch so that's actually code that will work because it uses this curtain builder called lunch it's called lunch because it's used to fire-and-forget a curtain it just creates a curtain and that's it it works on self in background just like starting a program and activity just like starting a burger on thread you know it works on itself and the the lunch itself will just immediately and everything it does will be happening in background whatever logic you're writing is curly braces will be working in some background thread pool so including this process personification it also be done in some background thread pool but what if what if I do your application what if after this all completes I want to update my UI I can't believe my UI from some background thread I have to do it from a UI thread whatever my UI framework is all UI frameworks are single threaded they all have the event thread you main thread or whatever it's called I mean they're all conceptually the same in order to do this all I need to do is a pass the corresponding context to the lunch curtain builder so I tell it not just simply launch a curtain in some default foreground thread pool but you use these particular contexts for execution it is explicit so it's in the code words gets execute and my process possibly will get executed in my UI thread whatever it is for every framework out there will have the corresponding context implementation let make sure that the execution is dispatch on its UI thread so that's it having said that you might be wondering so what's the metric of lunch so we said we can simply start user suspending function but somehow makes it possible is it like some magic you know building functional or what actually it's not if we look at the simplified signature of the lunch from the library we'll see thats lunch is a regular function it doesn't have a suspend modifier you know it's you can walk in from anywhere but as a parameter it takes a block of code that you know that is marked with suspend so whatever you write inside the lunch has this super power to suspend execution even though the line itself is not marked with suspense so like lunch itself doesn't wait for anything that's how because it's not marked you know it doesn't wait for anything just returns right away and in who turns it's also returns an object called job that you can use as a handle to curtain if you if you need to track your flight time wait for it or something like that so it's not completely a fire-and-forget but it doesn't produce any result the job is not even a general type so it doesn't have any result I've defined it just for curtains that just do something as opposed to curtains that produce some kind of result so our next topic is going to be async/await so you've been listening to this and you might be wondering so why not we just do it in constant the same way like everybody else does and by everybody else you mean languages like C sharp like typescript like dart like Python there have been it's kind of so establish a tradition of how to do this so for example in Catalan you do a sequence programming by using a suspending function NSC sharp it looks like this and C sharp has been the pioneer in this respect it has introduced a single weight and support for a synchronous programming as one of the first language is out there more than languages out there and then e this approach was copied you know to all the other languages so what's the difference in this approach the difference is that instead of suspend when you fire c-sharp uses a sink there's the first difference that we immediately see beyond all the syntactic differences between languages there are difference we see that there is a weight keyword that is used to specify where we wait so in calling we don't have it and we only seen our idea where suspension happened and and you know in c-sharp we have to use this away keyword but what's the third difference it's not so obvious but it's actually very important is that a sinc functions in C sharp or any other derivative languages that follow the same concept they which are in the future so in c-sharp is called a task but in typescript JavaScript is called a promise but still every a sinc functions in languages with a single weight keyword they do return the future so and this s gets closer to the question why don't we have a way keyword and call my why the hell it's a different approach why don't we just follow the lead of all they're like other languages that were proceeding us and just copied their ass in weight concerned to understand that let's see what's the problem with this thing in one which is with async await like c-sharp and others there are two conceptual ways to invoke and a synchronous function one of them we just call it like request talking if it's a synchronous function in c-sharp then it's a valid in vacation entrance immediately it produces ask a task that's that's promises to return us a token in the future but there is another way between bakit by using a way to restore an expression this also valid expression each wait until request token is complete and produces it a result of token type the first usage is concurrent you mean we're having concurrency here when walking something and continue work while this activity happens in programs concurrently with everything else we do and is it it is the default and when we just like c-sharp and their derivatives and the second way to use it with a way key or the sequential behavior we do 1 2 3 4 whatever do step by step and in modern world you know the sequential behavior is the default we should expect that's what we need that's what we do most of the time where are these complex logic nowadays that are castrates lots of services on both back-end and front-end and what we usually want is do something wait for they do something else with the result and so hemming it concurrency as default doesn't seem right for the modern world we're living in and there's also file Asafa chol you know note to it that concurrency is hard you know whenever we see concurrency it has a potential for bugs can constant has to be explicit I mean when it when a language will do something in this concurrent and it's implicitly concurrent just because I'm most function it's bad it's it's a receipt for lots of bugs in our code so content has taken another approach constant suspending function are designed so by default you get sequential behavior and if you want concurrency you have to opt in to it and we'll see how it's done in cotton in the phone section so how is I'm cutting so what is the cotton approach to this a Sinkin concurrency story first we need to find a use case why do we need concurrency or this is in Kuwait in the first place so let's take this use case this c-sharp example that has a simple way so assume we have an ax synchronous function that loads an image again a simpler since it sharp means it returns a future called task so we know okay you just immediately what we'll do with it or we can do with it we can start loading two images concurrently we can get promised or than one image it returns immediately then get promised what they are the image and they will lot at the same time both of them later on we can go and wait for those promises to get the resulting images and then we can do some process for example combine them to get some resulting image so this way we can get concurrence in our code so I think await is indeed for concurrency so how would you code learn if we don't have a sinc functions in cotton we have suspended functions instead so the way to define a synchronous fashion cotton in this you start with the regular function a regular function mean doesn't wait for anything it returns immediately to make clear it starts some concurrent activity we name it with the sync suffix this function is going to return us a future and the type of a future we have is called deferred it deferred it's just a synonym for promise and future so when we develop this library we really had a challenge because you know in Java world the name futures already taken by Java future the name promise in taken is taken by JavaScript so how do name a primitive that is a future so we open the Wikipedia and nicely you know on the page that tells about the futures and promises itself you know their future promises are deferred three synonyms for the same concept so always the deferred not yet taken so we'll use it why not you know it's seen on so and in order to return this word we use a sink curtain builder so in Kotlin a sink is not a keyword it just yet another curtain builder that takes a block of code that executes some synchronous activity using suspending function and return city for it as a result so when in c-sharp you were testing at the front you were at a sink phone function or whatever you don't have a keyboard function in C sharp you have function in JavaScript in kasnia you ready to the end so we are doing the right hand side that's assessing and now by having defined this function then you can do the same thing as you do in c-sharp as everywhere else we can now start both loading images concurrently because it's now synchronous function returns immediately loading happens in background then we can wait for both images the only difference here again we don't have a weight keyword instead we have a weight function well you saw it on a different kind of future so by convention when you have a future we named the Chris Mundy function and weight it's just convention which were choosing to follow it's not bacon to the language and the end we can do our post-processing we can combine images you know do whatever you want actually the code that I've showed you is not idiomatic cotton because in cotton it's not idiomatic to define a sinc functions in the first place because again a sinc functions are concurrent functions when you invoke it I mean it's nice if you name them with a sync suffix so your users know they're doing something concurrency is better if you did anyway it's not a good style to define first because again it's concurrent in concert has to be explicit so in Catalan what you would typically do you define your loyal image function as a suspending function instead of you find it a sink so now if you define suspend function means when we walk it it won't shoot a concurrent activity in the background it will I will ignore wait suspend until the result available and returns me an image so but what if I want to do concurrency how do I opt-in interpret current behavior easy what I do is I use a simpleton builder just where I need it so if I want to a synchronous DeLoach anybody I say that explicitly I say put is the sequence the law the image for me right and then I can also ask person who owns the other one you know meaning do it in the ground you know now it's exclusive now I look at my code I say oh yeah it's doing something concurrently it's it's launching some activity in background and then I can wait you know for both of them combined in return result and this is it is so let's recap what is causing the processing so in cotton we can use suspended function normally and it produces the result we can use them with a sink car team builder it will produce a future deferred result so the first is sequential behavior it is default in content and there are this concurrent and you have to obtain it to do that's the key difference between cotton approaches unity and the classic approach to a synchronous so in our next section we're going to talk about curtains so I've been using this word curtain curtain curtain but what it is what's this Curt Curt he means conceptually like you can open Wikipedia encourages wouldn't help you in its light less to understand what is it well say oh you know this concept was invented by Donald Knuth you know more than 15 years ago blah blah blah but what it is how do I conceptualize it in order to the easiest way to construct a 13-4 especially for people who've been within code in GBM is to think of curtains as very lightweight threads and what do I mean by lightweight threads in order to make this analogy easy to grasp let's take a look at example so this is really soft small self-contained example well we'll also see some new things going on here first of all our main function is defined where run plotting curtain builder it's yet another curtain builder that we haven't seen yet what it does in curtain builders have functioned that regular function I can invoke in my regular code and that can use a suspended function side of it but what it does it would actually block the main thread until the code inside of it completes that's why it's called run blocking so blocking is explicit then I would use a regular cotton list function to create 100 a list of hundred thousand items and that's going to be my jobs and each jobs I'm going to lunch and you remember lunch card billet returns a job so we'll collect them all until this list and inside this curtain I'm launching I'm going to suspend the execution for a second and printed out on the screen at the end when I'm going to do I'm just going to use a regular forage construct to join all the jobs joining is like it's just waiting for the job to complete so let's see what's going on so so here's the code I have no not this one sorry this is even the wrong project this one oops oops oh my god that's bad so hold on let me let me let me see if I can fix it if no not this side doing oh here it is here it's showing you no okay great so here is the code let's run it oops it works and after seconds it prints does and if we actually count there will be a hundred thousand dots on the screen so it just works lucky charm no problem with that but let's let's try to do it with threads and that's that's kind of this exercise will let us build this concept to do it with thread we'll have to just change three pieces of this code so we don't need to run blocking with threads because with resin only any part in builders and there's no lunch no July 10 threads instead of lunch we'll just use thread function that's available in called in standard library instead of delay we use thread sleep so our code becomes like this everything else stays the same you can join threads you can start them you can wait in them using thread sleep the rest of the same so let's try to do it here we are not this one not this one sorry let's run project again oh my god I know it's a right project so I'm looking at my screen but I operate okay here's our thread code so the same just just for thread oops right oops you see we see out of memory error unable to create new native thread so this kind of plane later shows us the stress is just too heavy wait we there's no way we can create a hundred thousand thread something decent hardware and that's the key difference like conceptually Kirkenes are just like threat conceptually but they're very lightweight so I create lots of them and I'm not it actually changes the way a program because with threads I have to save them like I can't just start a thread when I need it you know because it's expensive to start but with carotenes I can program in the whole different way and we'll talk about that in my talk tomorrow what's actually different programming styles I can how changes when I have curtains in my disposal we also talk tomorrow at some internal details of how those has many functions are built how curtains actually started but let's let's continue with this stuff the other topic we'll talk about all this Java interoperability you see we we have to maintain the applications well we have to integrate an Interop with lots of existing libraries in GBM and actually the same problem GS the only way I define a synchronous function on GBM is through some kind of a future again in this case it's completable future from but maybe you're using some other future library using guava alyssum or future maybe you're using some other frameworks future what if I have to write a function that lords two images concurrent list we've seen combines them and returns result in all is it in a synchronous way I mean let's try plummeting so in Java switches will look like this I mean it works but the code is such a mess due to the composition apparatus or how to use that we don't see the actual business logic we don't see what's actually going on which you see the chain of Combinator's using one and that unfortunately every kind of sync result that we have to write nowaday looks like this it's hard to us what's going on fortunately for us what we can do is we can we can go ahead and implement this code in cotton instead like this the beauty of it is that cotton functions are just like Java function so if I define my cousin function that returns computable future I will be able to use it from a Java code as such but the because of the carotenes I have a future Curtin build that's divided in an integration library that returns me completely on future and runs the curtain inside of it so in with this fuchsia curtain builder I can write the code in such a way that I clearly see what's going on that I'm loading two images and synchronously and then I wait for it and again by convention if I have a kind of future I would have an extension on it called a wait to wait for it now my code is clear and you can immediately see what's going on and you can still use it from Java you know no problem if you have a lot of legacy Java code last but not the least is important topic that cartoons actually go way beyond the Cintas code so we've been talking about writing a synchronous code because that's kind of the modern world we're living in but carotenes is let you do much more than write a synchronous code take a look at this example this example defines an infinite sequence of Fibonacci numbers and it defines in a nice imperative way without combination so certain clear see if the code and see that it does define Fibonacci numbers it does it by using a build sequence cards and builders as part of the center of library and inside this bill seconds builder I can use yield which is a suspending function that lets me returned the next result of my sequence it's defined using the same building blocks that we already see there's no new concept to learn and the language we see that you know build seconds it's just a regular function that returns a synchronous sequence a regular sequence type from the cotton standard library that you should know and love but it's defined to take a lambda that is a suspending lambda marked with suspend modifier the only difference from the lambda that we seen before it's that it's also combines the other cotton feature into the mix it says suspended above Weiser server so inside of this number I have an instant of sequence builder available and synchronous builder this abstract class that defines this suspended function yield so we can return the next value and it's also marked with this special notation convert strict suspension which actually makes sure that we care that everything we do is able success synchronous so we can't just wait or do something else doing network or something like this when I take when I talk about synchronous what do I mean synchros so let's take a look an example I am because Fibonacci is a sequence in order to iterate over that first create an iterator then as soon as I invoke next the code inside boxing will get started and will run until the next suspension that is yield and it will yield the value 1 and the next will return this result then if I invoke next again the curtain get resumed again now it loops onto the next yield once more and returns 1 again if I invoke it again and it returns two and etc every time I invoke next the curtain runs signals that was invoker invoker controls the lifecycle of the curtain completely unlike lunch because I used lunch curtain works on its own it works on some background threads it's in its own control when Turin went to wait what to do with synchronous carotenes it's completely in the power of a worker whenever in worker calls next only at that moment you know the action by Cardenas perform so that lets us do infinite sequence let us represent many heart to express concepts with cotton in a nice concise code so we're coming to conclusion and running out of time so let's talk it's a closing section let's talk a difference between library support curtain and language support for curtain so in languages like C sharp Python JavaScript typescript the usual approach the Sigma T is by adding keywords they would have a sinking away keywords they were generating yield keywords for synchronous carotenes etc etc that's the classic approach in cotton there are just suspend and so even keyword is just modifier I can name a function suspended I mean not limited to using this word for other purposes the other difference in cotton is a Content standard library has really few primitives to support curtain I mean just a few there is some primitive skirting builder primitive suspension functions that we'll see in the topic in the talk tomorrow and everything else it's just a library outside of the language so what everything will be doing there is we're doing through the library called cotton excursions which is open source and github it's been an active development its production already it just like curtains where we're evolving expanding it to prepare for the ultimate you know finalization of the curtain in the future and curtains are experimental but experimental eccentric told you and that's the good point repeated does not mean unstable curtains are here just hello curtains are here to stay they will will not remove them will not break anything in 1.2 so inside one and one and one point to every updates we do they're backwards compatible even though the future experimental we still maintain wireless experimental maintain backward compatibility so whatever you do with your curtains coronel will continue to work we will to finalize the design the future meaning you know you will have to migrate to the final design but will provide tools to help you well put all the old libraries into artifacts that you can still continue to use if you want don't want to migrate just right away so please do play with them do use them a production and give us feedback while they are not finalized we there is a chance for us to take your feedback into account it to make it even better thank you so yeah we'll have a minute for questions yeah yes here it is it's not a threat I mean the signals curtains not a thread whenever I invoke next right there in this same thread the code will resume and we'll execute and garbage collection works as usual while I'm keeping reference to this situate my state and says the sequence is kept and will actually come tomorrow and we'll actually see how this code like this gets compiled and this probably will answer your questions on how is the garbage collected where the references gave etc etc yeah no you cannot implement suspended functions in job yeah will answer this tomorrow yeah yes yeah let's so we're out of time so let's do the rest of the questions offline I'm here available police come so I'm right now I'm really here but later on you can find me at jetbrains you know boost and I'm here to answer thank you
Info
Channel: JetBrainsTV
Views: 94,929
Rating: undefined out of 5
Keywords: KotlinConf
Id: _hfBv0a09Jc
Channel Id: undefined
Length: 45min 32sec (2732 seconds)
Published: Wed Nov 15 2017
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.