Quarkus Insights #8: Mutiny - the reactive library

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello and welcome Marcus insight episode 8 meeting me the reactive library with a special guest Clemens coffee [Music] good afternoon evening morning night you know wherever you are welcome and today we're going to talk about well generally reactive programming but specifically about a library called mutiny and for that of course I've got my partner in crime max to try and figure that out because we're not reactive people but chemo is and I will you know help us decipher the subject hello Kamal hello thank you for having me you know we fought you into it thank you for hosting me doing this max you said we had just a couple of subjects before we go into the core of the subject right yes one is if you want to have an episode for money [Music] that's happened when I share Google Chrome last time and I am sharing Google Chrome at the moment so but that was the problem on your site the first time all right oh no it was me remember I forgot to mute something yes it is it better people one two three I'm not a robot yeah anyway so yes so the global a cathode go to quirky style slash blog and that should work the other stuff that Max was presenting go to get up / quark Rosario / Quattro sigh oh no Holland it's this one it's not the main Quercus reports the quark uses IO dot github doll uh-oh repo and from there you see the bunch of issues and there is forgot the label if we go to labels insights is the label you're looking for please votes for the subjects you're interested in and then please if you if there is a subject that is not covered please add it and we will use our total benevolent dictator rule - what's the next subject is depending on availability of people and and and so on all right so so clemo tell us a bit about yourself before we dive into mutiny so my name is Clem oh I'm working from France after World bit before going back to France I'm doing a lots of things around overactive I'm working on without so I'm doing Reiki stuff at way that I did a few years of vertex and recently I'm more involved in the caucus world and small wine world I have done since or on micro profile and directives or I went to streams opsin microphone white give me sending and today I'm going to Montana little bit then but mostly speak about a new library we have been building for the last 10 months also which is named mutiny and why we did that and and the difference with the other active programming library I was confused before we had the conversation into you know wine in tinny and so on conversation with you and I had is is it vertex this reactive library already so what's the difference we know that vertex is at the co of workers so why not graphics so exactly so vertex is a core of Quercus but it's an engine it doesn't expose an API actually it's the opposite caucus X protects exposed multiple up eyes so at the bottom what you have is not looking at you and the reason you want to do non-blocking i/o it's because in the cloud world with the level of concurrency we are reaching these days you need to if use you associate more efficiently and when I say what source is I mean CPU memory hard disk and so on nothing is free especially on the cloud even if you are on your private cloud it's actually also very expensive because everything that an application is is consuming means less for the other containers or the other applications that are running on the same virtualized host so we want to use non-blocking i/o to improve this efficiency what not working arrow means is it's actually relatively simple you delegate a lot of things to the operating systems that will call you when something is ready to be consumed so if I don't really want to do requests to a remote web service you say ok request this and call me back into travel world there is one number or libraries that everybody is using these days it's Nettie so Nettie is awesome it's great it has a big ecosystems so tricky things out using Nativity is a little bit hard it's it's really low-level it's it's actually just a little above not looking at not looking Isle but it's it's very hard for for bare motor to develop against it so and vertex is layers that come into between these and makes the net EAP is a little bit more easy to use it also come with some different facilities to under what we call the context event loops and thing like that and the event loops aspect is actually key here if you use an unbreaking Iowa and why it's interesting to use non-blocking i/o in in this cloud world it's because you are going to reduce the number of threads and by reducing the number of sweat seals Biosystems you are going to reduce the memory because it's read stacks memory but also the cpu because of the context switch so for doing this what's nitty and vertex operating is an event loop systems where you are going to always be called on the event loop this is the thread that is unlink the IO and there is well there is a few formulas to compute the number of event loops but basically you can say that the number of CPU cores which in a cloud or in a container is generally 1 and here is a catch if you code if you use a code your application code get run on the event loop you must not block because if you block that that means that these threads cannot be used for anything else and if you don't block that means that you get a request you do your things in a nonworking manner and as soon as you cannot make progress as soon as you need to wait for something you will leave the thread and something else can can can be mark the thread would be used when there are no serve requests so this way you can under a lot of requests on a minimum number of threads so vertex to come back to vertex it's this layer that will make this a little bit easier to do but vertex by default the API that is exposed to the users is based on callbacks the advantage of Corbett is that are easy to understand it's really a one as it said callback so you pass a method that is called when you get the answer so it's really truly suits well the non-working area model so tricky thing is that while callbacks compose very very badly in the sense that if you need to do something and then wait for an answer and then do something else and then wait for not so I'll do something else then you already have three nested callbacks and you have some spaghetti code that is not necessarily easy to understand nested indentations it doesn't really works well it's nice for in a world of four very simple things it's actually the most efficient model we have but it doesn't scale in terms of development and card so in vertex is going to provide this this callback api for the complete vertex ecosystem which is huge I can't remember I think there is more than 80 different components into vertex ecosystems big difference with nature and where she said it or not but vertex have higher level a higher level than 80 but also a massive ecosystem of connectors that are non-blocking so connect to Kafka already exactly X so some of them are actually based on the Nietzsche codex and some of them are actually just an implementation or active implementation of those clients but they're all not looking phosphorus and then what's coming in the vertex for no actually are in 3.1 is SQL Server and tbh to enthuse on the go so you got a decent coverage of databases well it's not only databases so you mentioned the database but missing links of Cal Cal rabbit MQ I'm QP Ivan no sequel database I create this and so on the vertex ecosystem is really really huge and can go from IOT gateways to work wiggler microservices calling web services building web apps template engines yeah it's actually reused one question just just for a new peer so mute move is built on verdict or its library and on top of it we expose a nice well the vertex team exposes a bunch of other API they could be completion stage based it could be well mr. Clement but then no polyglot so even if it's always based on the JVM but you can use vertex with groovy Ruby JavaScript and other language the most popular these days of Scala and cotton so vertex provides all genetics API to all these languages and then in the Java world to cure the world vertex expose a few different API so you mentioned completion stage but we also have Eric drama - and moist until Matheny that being said Matheny is not bound to vertex at all we have all the vertex ecosystem exposed us meeting API but meeting itself is an independent project we work together to to make them fit about yet it does not depend on on vertex itself okay so these are sampling fibra these are the input and return types in a non-blocking fashion and before we zoom to mutiny we had a couple of questions around vertex and your favorite things like loom cackling coroutines so let's have a couple of a quick actions before we actually shift gear into into knitting so what do you guys think about the project loom and its touches on the reactive world in Java so it's very promising it's going to make the development of not working a synchronous application or a lot easier in the sense that you don't need to use a non-blocking a synchronous development model that being say it's not a silver bullet either you will have to do things using racket programming libraries because there is not to same type of construct at the moment so I tried loom so the build of loom I've tried was built and of may so my what I will say right now might be a little bit updated so very 9:00 with that it's there is a few things that still need to be covered so typically in loom so what who means so loom is introducing virtual threads so basically in the loom world you have a pool of carriage threads generally the sender boss event hoop sound not even troupe and then for inside each of these courage threads you have virtual threads which well we are like twin threads for the old Java developer let's say but in the sense that you can have multiple virtual threads on the same canvas traits so everything is fine and the great thing with limits at virtual threads code so the runnable you pass to these threads can block and what the Lu magic here is that it's going to detect that you're blocking and actually keep you somewhere but we leave the carriage threads and the carriage thread can execute another via to our threads so so far so good except that there is a few construct from the riviera that are blocking karates rates typically synchronized away weight object weight and notifies so these things are still booking the carriage threads and there is a few other constructs that are blocking actually and here you need to be very careful and and things as I oh yes there is loom and I will use loom and I don't need anything because most of the time you will need to tuner a little bit you infrastructure and middleware to avoid all those carry a blocking operations because that's just something as an event loop if you block the carriage threads you kill your concurrency so you really need to be aware of this so what it means just just to to show them the subject that means the ecosystem will have to adapt to loom yes to some extent plus is the whole data stream aspect which is not covered by by loom itself and exactly are typically one thing that is correctively hard to do in pure loom is to call to services to remote services concurrently and join on the result yes you can do that by starting new get your threads and signal that but then you use features if you use features where you can already in the synchronous world so it's kind of a little bit misleading here so I believe that we will still have a zoo to work side by side the good news and that the result of studies are I've done recently is you can use the vertex client meeting in version of the vertex FBI's on loom and this is not going to block the cameras right so so yeah lots of prototyping still to go for right that's something we monitor and we keep an eye on by the way the performance of loon at this stage are pretty heavy on the garbage collector so there is also work to do on that one quick question I probably can I'll just address what is the difference between an event loop and the worker loop pool so even group is really where things are supposed to happen in a non-blocking fashion otherwise you delegate to stand another event to make it up and the Walker pool is your way to ship the to mix the new world of non-blocking into the old world of stuff that would block a thread and the session should be a worker thread that is here to say okay you're doing JDBC in a blocking fashion I'll pass the operations to that worker pool but it's it's an old slide pool that is blocking if you consume all of the resources and yada yada so it's a it's a bridge with the legacy universe as as much as possible try not to have to use the work of polishing to try to go for the full non-blocking fashion and the final question before we go to mutiny it's it's around coupling so any opinion around using vertex with coroutines using Kotlin it's the nice you know blocking light but in a non-blocking like and then it's it's a great combination is it's probably what i will go for these days if i will be efficient in cooking which is not the case unfortunately yet but yeah it's a great combination so coroutine support with vertex works great so you can already have nice code and yeah it's kind of give you a flavor of bloom but yeah it's good lean but try it it's it's actually very enjoyable I like to see cracking codes in supporting workers and/or mutiny and being able to move from uni to a suspend function or close is tried to be done well first of all Ali please go to the github issue and they're probably already is one but please vote up add your use cases on it that would be very useful be I'm still unsure about the full support of coroutines inside grad VM which didn't achieve image computations so I can show that that doesn't work yet it's an active completion issues worms for loops with multiple entries so in deviant mods there is no yes it was very well means Quackers and oh yes and it's it's actually the same for loom in native mod well I didn't try but I believe which will have a few few a lot of native completion issues first about mutiny to suspend apart function the good news is that there is a code lien support a missing so the idea here will be to add some method to the Union multi type for mutiny we are going to see them to make them or to make some operations expandable so that's where we are at the moment I didn't try recently so it's something you will need to add yourself but yes that's okay all right so enough question about non mutiny related stuff let's show mutiny so again for people that are bit unfamiliar it's a bit like Eric's Java or a bit like completion stage plus the equivalent in a if you return more than one result and I'll probably share your screen claim oh yeah I'm just click just let me know if you see my screen okay you go we see your screen we see the main method oh yeah great so let's start with the basics and the main results so the first thing is why why we did we wanted to do mutiny so as I said we wanted to avoid callbacks because words that expressing the event-driven ideas behind a non-blocking i/o it doesn't compose well on the other side you have reactive extensions and reactive extensions implementation like a rich Java or reactors they they are great a lot of different operators and the tricky thing is that very quickly and we have look at the last five years you God is not necessarily really born in the sense that it's January hands up reserved for rest of a jungle of map and flatmap and it's very hard to follow what you are doing and actually a lot of developers don't really understand what flat map means and what how each bas and when you start discussing with them and say oh yeah but it's not flat map you need its concat map and say oh what's the difference and people just say plus one if you know what flat map versus compact cut map means and I don't know plus 2 and then minus 1 if you don't know what it is and then let's say 0 if you know the difference between map and flatmap there you go I minus 1 basically so no shame so now yes the tricky thing is that to use those libraries again which are very very powerful but to use them correctly you need to have a deep knowledge into them to to rearrange the dark understand almost I won't say all the operators but at least 100 operator so the main operators and can be hard and the tricky thing is if we are working in a team even if you have the knowledge well what about you coworker if you write 3 change flat map really understand what it means so that the kind of things that we have seen over the last few years and actually it's the same question of a manual just ask I have asked in several conferences or even customers and seen a lot and I've been surprised by the answer and say oh yeah you're running in production ok yeah so it can be quite complicated you you really need to say read the doc but I think these are fundamental operations a bit like if you had to read the dog for ethan loops right luckily i'm pushing a bit the limits but that's that's why i feel it it is so yeah great max I'll just say that make most haters at minus one so maybe we want to cover some basics yes I'm going to okay so the idea mutiny is to really try to build a rack of programming library which was not really an implementation of proactive extensions with all those map and flatmap practice to provide them if you understand them but provide alternatives that we believe are exposing more expressiveness and easier to read and to understand and to understand your code mutiny is based on the idea of events and it's really an event within libraries that are not a big difference with the other libraries so heard my car the first thing I'm going to do is retrieve a uni from a stupid and dump a service that are created which is named good things and let's say lemon okay so here I've created our retrieved uni from this service uni it's a nursing Cronus construct which will receive events and uni can have two types of events on item which means the result or on failure which means that there is a failures and you need to under the failure so greetings you just saying hello claim or something adult and when I get this item I want to transform it and say I want to just do a pro case or something like that obviously you can have failures and when there is some failures you can say okay I just want to put on hello something like this if I do this nothing happened even if I execute this and I can show you I can execute this and nothing is going to happen the thing is and that's the big difference with a completion stage if you use completion stage is that you need is lazy just answers if you don't say oh actually I am interested by the results nothing is going to happen and to do this you need to do subscribe and for example sub-query with the item and then I'm just going to print it so by doing this I say okay I have my unit here but I'm actually I really want this these items and just print it so if I run this I should have a little mo in uppercase so obviously here you can also under the frailer here if we have any failure so something is out but we don't have any failure here except if for example here I just do whatever so if I do this so if something bad happen during my event processing is going to fail we cover with the item hello that I will print it if I don't have this line it will just go back to the printer Spectras stack trace that we have here test another carpet yeah exactly so that's a little bit oh it worked so we have this idea of items that you either of advance that we you see here and your events are flowing inside your systems so obviously when you have an items you can do multiple things like torso meat just having a look at it like a peak delay it for example that's mostly for tests fail you were not expecting some events you want to fail or training some also a second news operation we are going to see that in a few minutes and produce a stream so we are going to see that and so on in your and so on so uni is great for a synchronous operation it's it's really mapping in a synchronous operation and something to keep in mind is thanks to the subscription pattern we have here we can actually cache the Uni here and call it multiple times while here it's going to answer the same thing is the same the same response but the idea here is that actually by doing this you can eliminate a lot of of the execution time and we are going to see that in details in a few minutes so uni is great for this but in mutiny there is another type watch Alex drawing for about uni uni can return null yes so you cannot actually let me do this unified is is actually quite common it's something like you have an operation that completes but does not return any any anything so like flash operational and so on so you can create a universe like this all you can actually have our uni here and and I don't care about the result and dunno I can return that and I need to subscribe with and here we get no so I need something yep and it's something that if you are familiar with all the racket programming library might looks a little bit weird because they generally forbids null in mutiny for the unit type we accept no because knowledge part of the Java language and yeah it's there we like it we don't like it that's that just there so and uni avoid is actually quite come on so here remember Quercus is here not to well it's opinionated but we try to reuse a lot of the programming models you know of for example hibernate and hibernate for better or worse in GPA there is a way to say fetch me this object and if this object doesn't exist it returns null right so that would be a perfect use case for for that one for example by the way so what I look at the mic Clement says we will you be talking about Kafka probably not that presentation but we can definitely try and cue Kefka subject for for later that will be too much I will show a little bit of Kafka but it's not going to be much about Kafka I will see all mutiny and calf Kara can walk together so just just just before we go I just saw these lot of - ones about people not maybe not fully getting a difference here but so why is this good what I look at it's code it's like okay that looks sensible but that looks similar to what I've seen in the past - well in the past it would be something like I cannot even write it in Eric that would be something like not so as you can see we would provide it and then I don't have the equivalent on on failures so that would be in Eric that would be on on a row we cover with or something like that and the tricky thing and we are going to see that's when we are going to chain a synchronous operations what you end up very quickly is a chain of flatmap so a flat map but actually it's you get an item's you are going to call and a synchronous results and flatten the results so let me direct something so Frank asked something which is using mini from Jack's arrest resource with the context to just eg security will it be propagated and the answer is yes we have something called context propagation that will do that work and that ties nicely with another question by the same person that says have you measured the overhead of mutineers the library put on top of the underlying vertex and right now the context propagation is an expensive proposition compared to the rest if you do very little and that's something we're exploring into into optimizing desire fair summary demo yes exactly so of course mutiny and the mutiny clients are the little bit of a little cost on top of the queue of ethics API but you get it as a as an expressiveness and avoiding the callbacks nested callbacks context propagations is an expensive operation at the moment we are we have ideas to reduce this cost balls in Wakeeney and pause in context propagation so it's a few leads that are converging it's actually can be disabled so if you disable contact propagations and you don't pay that cost however don't expect your security context be propagated in that case because it's not but yeah so that's more less oh it works I'm going to look to explain oh it's integrating Quercus just one time I've shown the second type which is multi so muchi is a stream of data so uni you can have either an item or a failure and the item can be nerve on a multi you can have a stream of data potentially empty so potentially none or failures of the collision signals so let me show you this so let's imagine just dot okay so so that's just I can't remember it so random yeah it get it get random number I've gone so every something and we get sauce it's something you for you right before the it's like a message returning a double and then you start from there exactly so here I can do well the same kind of operation I get my double I can for example convert it I don't know something exact and then it's a same thing I need to subscribe and for example and when printed so it's mostly the same thing and in the multi API you will see that we have an item on completion on failures there is this Oliver flow which is rated to back pressure I'm not going to go too deep around that but basically on multi we implement latest wins and the backwash of protocols that is in in specified in rocky streams sometimes you are sources of data that does not respect this back pressure so you have this on overflow which is an event and meet innocence where you can do things like drop when you see items but the API is mostly is very similar to the multi one and that the wall ID in the sense that you are writing two events and events are items failures and completion in that case we get our items here and as you can see there is multiple items in a multi there is one question for the Ashish Hawkin can you call multiple methods in parallel and merge the response yes with all night tempo deuce unique and yes that's actually something that is related to our flat map description and I'm going to show that in a yeah in a very real example because not just to explain a little bit the two types so if we switch to caucus most of the caucus appears our Mutiny support and typically today I'm going to use no go with panache and the reactive facet of Mungo is Spanish so you already have an insight about panache I think it was last week as a week before remember always polish poets know about with panache yeah Mogo with panache is the same idea in the sense that you express you want your you structure here and you don't have to do any mogul rated operation it's going to be done for you and you have the same Modell way you can have static missiles and here I'm just getting some up I want you to show this one actually getting a random villains and a random hero so here we have two api's we have this this one for our villains so as a French I cannot pronounce these words correctly so let's say the bad guys so that's lots of bad guys so one of bad guys when we want to run down bad guys we go to the to the collections we get the number of documents it's Mugu so it's documents we are computing out taking a random random number and we are going to retrieve this the chosen a bad guy so for this I'm going to use fund or page and so on so this is actually a panel forgive that what's interesting here is this produce uni here so basically it means I retrieve the number of documents this is a no second no separation once I got the result I computer random one so there's I pick one okay once this is done and retrieving this bad guy from the collections so the second operation is named on item produce uni because on item you want to execute some asynchronous operations at which we've something if we look at a rose and if you are familiar with the racket programming you you will be familiar with this because of the same code using map and flatmap where you have map and flatmap so on uni map is on item apply and flat map is on item polyphony so there are shortcuts so now if I go back to my by the way I don't know about you guys but the maybe that's because I don't use reactive you know every day but map and flatmap always escaped me so at least the on item produce uni and on item apply is is clearer to me than map flatmap and the flatness of the fourth of all the alternative api's so we provide those we understand that there are common operations and you some people understand them and can under them but we also there are truly just short cuts over the produce uni and apply in synthesis okay so let's see how its integrated in inject series because as I said most of our API is having support from whittany so if I want to run them you here so the good guys okay so here I'm going to return unique [Music] you know and here well because mogul with panache is doing everything I just put on my random heel and I yes service is working so if I do this I forget her Evo yes so the good guys from the database so typically here I got kick ass even three that's a picture and some IDs and if I do another one Superman and another one icon and you don't know that one and so on so I will do the same thing with Villa so the bad guy and now I'm going to try this and yeah Mephisto I know that one out his phone that's on unconscious red things you cannot spawn pizza and so on so there is also an integration with multi and actually it's it's mostly used when we produce stream so SSE so we can do something like this multi of Eros and and I say that I wanted a sec so produced media type and oops oops [Music] I come from SSE Lehman type sorry media types don't so basically it's an SEC of Jason that what it means and here let's say I want to with Weaver in raw if we so gone saw something in that I will create and will t quite from ticks every I said after Segond one and every second I want to reach with a hero and I'm going to call this get random hero so here it doesn't work because why this could work on this would work on unity doesn't work on multi and the reason is that this is actually a real flat map and in flat map service pupa there is a map that we have here produce uni we produced an ascent gonna start here uni and then we need to define how it's getting flattened so do we want to concatenate do we want to make our melt with concurrency and we just got a question about that yeah so let me just the difference between males and concatenate so let me try to illustrate it here with comments imagine that you have the stream ABC okay such a stream hey fellow but be followed by see if you have an operation which is a synchronous with who produced for a a for B B and for C C so so far so good you just doing an upper case but it's an upper case which is executed on a remote service something totally asynchronous so you don't know when a per case a upper case B an uppercase C are going to be produced so if you mare you can get as a result B see a because maybe the operation to produce the upper case a has been slower than the operation to produce upper case B and C sink in the cloud where you have multiple instances of your service that is likely to happen because one of the instance might be a little bit less loaded than the other one so you can do such kind of things if you use concatenate you enforce the order and then you can get a B and C because that will keep the order from your input stream it's not only this man can actually execute the three operation concurrently because it doesn't care about the other so you will say okay I will start your person for a 4b and 4c and as soon as get get something I will I will write them down for concatenate it's not that simple because you want to preserve the order so I will execute for a and wanna get answered I will then execute for B and then for C so while here it's actually in computer concurrently here is going to be sequentially executed okay why the cockles are looking at merge solid so whites Nemco catenate because basically this is this is not doing this this is actually returning a stream of one element like this and you just concatenate two streams that's why I understand the name is not it's actually your name so I've picked from the other active programming library I don't necessarily like it that much I'm actually trying to find an alternative something like preserve ordering or something like this obviously in the melt operation you can express a level of concurrency you want and if you do this well you're likely going to have a concat concatenate because basically if we call a and then white for answers and could be white so the answer you can see and so on by default your level of concurrency is I don't remember check the documentation it's written inside got two questions can we return paging results in as mmunity um I believe the question is for the panache which I don't know but that's an interesting question so we're exploring the same subject for hibernate reactive thought for JPA and that's actually a more complex question than then anticipated so just saying hey let's abstract stuff as milchie is not adding that much value of just doing the pagination but as soon as you have a multi you can do what Clement just described concatenate or merge or things like that so that's that's where returning a multi of the results would be would be you know quite interesting in in in that model so we're we're literally asking ourselves that question and it's very likely going to show up once we were you know everybody's happy with the with the API having your feedback would be quite good so actually the question is when you do paginations you can you can see spacing you can return a list of pages of items in that case because it's a list it's generally first you tool of the complete collection so it's a complete set so you you are likely not really when you don't really want this so if we discount the first one then we have this second one which would be multi of pages so basically you will turn page of items and because it's a multi you don't need to load all of them but there is again the right distance protocol behind the scene so you can retrieve them one by one as soon as they are requested that's where is almost the best model and if you want to switch to a multi of items you can just flatten actually the items from the page inside yours or resorting items all you can return directly immunity of items if to just react to what's Emanuel said for most databases it generally makes more sense to use this Sudan approach here why it's because there is some kind of closer or batching or sings exerts so number of items you can retrieve in one batch which would be your page more or less and that what make the most sense and then in terms of API you can decide to go and expose the page or flattens these items into a multi yeah the other aspect is you could use what is called a scrollable wallet cursor through the database it's a bit unclear how common that usage is and it does require to keep that up and open is it really what you want even if you're in a non-blocking universe considering the database might or might not be you know blocking and the actual protocol allows you to have more than one week query in parallel so all of that is very mature on the database level to be honest or the classical a DBMS at least so that's one aspect hold on I do have another question for you if I find it oh yeah a quick one so claim oh yeah it asked could we execute concurrently but have the result in order currently yes yeah so actually it's a it's not so little bit different and I'm going to show that in the next class so be patient I'm going to use what we call combinations and you will execute code 20 and get the results in order another question is would you recommend using reactive routes instead of Jack's arrest with mutiny because the muties stuff would run a jax-rs worker thread as far as I understood yes so at the moment and that's important at the moment it runs on a worker thread where wake of roads does not run on a worker thread so there is a few works that are in progress right now the first one is to try to see how we cool one Jackson TenPoint non-working jacks a Western point directly on the event loop and in that case we will not need to work a thread and the second work is to provide a better integration between mutiny and or active roads and this is going well hopefully for in caucus 1.7 yes 1.8 is is right now so 1.7 so so the next one great segue for me to show the roadmap we're seeing right now is small right near Cheney website so types Moriah and mutiny and you'll find what you're looking for if you just type mutiny you know if you do walk to the Rio / world map it does redirect to a data project with our plans and I repeat these our plans on what we want to achieve for Quercus 1.6 and when it's landing what at 7:00 and when it's landing and so on so here in 1.7 there should be what mo is talking about which I'm not sure it is actually it's and I believe it's in the writing roadmap still need to copy that over these are the big big subjects and sometimes not all of them are absolutely ok and yes the other point is if you still have blocking api's and therefore will rely on the worker thread then it it probably is fine and okay to use rest easy in that situation versus going for the reactive rod and mutant in and fully non-blocking fashion let's say use classic hibernate that here you will have to do the jump from one thread to another anyway so that that's a that's where the question is really assets like what are you always using non-blocking library therefore the answer that Clement gave is is right if you're using some blocking api's then the function may might be the answer might be a bit different so something I forgot to show you but I can actually throw it here is that it's not because you get a unique so you need by default non-working a synchronous and so on so you get the events but sometimes you to switch back to the blocking world and to do this you can do fine on a wait and definitely utmost or something so you want to indicate timeout and then you get you your hair or directly so that was so you can also chain use mutiny API in the blocking code using this await since we have equivalent for all the multi things to get some looking into rebel or things like that and I had a question about loom at the beginning this actually is not looking the current thread so you can already use loom with this and that would work out of the box and our ID for coding convergence is actually to mix two other mixing around this so but I wrote this code but I still don't know if it works and because I got interrupted a few times and I know a little bit skeptical so let's let's try to see if it wants so normally it does not work why are ya forget to pass so normally every girls who got a new hero so that works so that's basically how it works so every times so every cheeks so we have a first dream that every seconds ami two ticks and for every ticks we get one the murals and we don't care about the other so we just mayor I could do the same with concatenate which in this case that don't believe make a lot of difference let's see right both worse but yeah we don't see if it Santa lived or not so but another thing is you see here I don't subscribed on my return uni and so on so seeing is that it's Quackers that is getting is recognizing uni and multi and doing the subscription and the right thing for you so in this case you don't need to subscribe it just going to walk um yeah I think on this yes SOT SOT Chris is interesting because it mixes the the nice stuff she got from the the imperative style framework where a lot of things is declarative but here you got the reactive aspect where when it matters and then we do the wiring some of the wiring for you so another thing as I said so we have almost everything in quartz that is integrated with Metheny and typically we have the micro profile restclient which is integrated so you can watch an uni or I think which is not supported yet but uni at least is supported and that's typically the micro profile right client for my for the API we just build so if I go back here so no other I have good guys and bad guys I want to make them fight of course that's uh that's how it works so I need to wait with a hero I need to achieve villains and make them fight I've injected my restclient as usual and now I'm going to do get from the evil hero and I will do the same thing which get from the villains but here if you are familiar with distributed systems and you know the complexity of distributed systems and basically they are going to fail you need to have some kind of error on Ling here so what I'm going to do is that on failure I want to recover with let's say a fallback whoever that is not going to under timer correctly what we'll do here is that if no item after let's say signal 1 fail so what I just did here is that I want to retrieve a random hero for my remote service if we don't get any advance after 1 seconds then we fail and on fader this one or whatever other kind of videos I'm going to recover with a fallback I'm going to do the same thing with the bad guys oops here so at that point nothing happened yet because no one really subscribed but they don't return to uni yet so nothing is happening so I want to execute a volunteer villains mini concurrently because maybe it's two different services and then join the results we just had this question a few few minutes ago so for this I'm going to create to combine my unis so all you need so here we are evil and multi and the bad guys and I want to collect the result of the topple and here now that I have a topper I have a union of topple are going to try to fight so I might topple to power but my first item is my yo my bad guys is my items queue for my top typer ok and now I need to call computers H V and I'm just going to return this and I'm that that was so basically what I did it's a shortcut for an item oh yeah sorry all that time apply right yes that's that's it so I got our presentation of my operations at which we leave an arrow and fall back if something bad happens same thing for the bad guys and then I'm going to execute boss concurrently once both succeeded then I get to topper with emails and below so it's a prayer and then I compute the outcome of the fight that's relatively simple of course here you can have miles and twos or running concurrently you can also combine with some different function you can stop at the first failures or fail fast on sync like that so I've seen a couple of questions around a how can I do some stuff sequence or some stuff depending on you know core that's why probably they want to do it sequential and some in parallel and you know combine that or reactive I think the answer is you combine those things so unique combined or multi combiners put it there is an equivalent will let you say I'm going to run those stuff in parallel and we've seen how to do the sequential a bit earlier in the in the presentation with the was it concatenates defined not wrong about the one that actually do stuff sequentially yes so if you combine those two and and chain you're you're you knees on milites that's why you would define literally a pipeline of stuff that can do it be happening in parallel and subsets that can happen in sequential maybe there would be an interesting blog posts who host somewhere or toast on caucus io claim oh that could be an interesting one so most of those answers are already in the small Y Mutina documentation but yes we can't write a blog post about that so the mutiny documentation is use case based so you say all do I run things - concerning your do I want syncing continue and you will see all the different cards and you mention it and I say hey by the way I have a different way of writing that I can say run Eero and villains and when both are done then get my chopper and so on that's exactly the same thing except that this is an instance a mossad and not a static missile there's nothing interesting in compute Phi to come and just doing some random stuff I love random as you can see everything I do is based on random but now if I go back one minute so yeah I just want to see ya the last thing I hope it's going to work yes so that's actually what we just built so the endpoint we just so this fight is called from the fight service and exposed here and you can actually run fight this is already on Geeta but if you go to my github account to search from knee to knee demo you will see this code and you can try that we had a question about kefka's so I if I go back to fight service here what I'm doing here is that sends the fight result to Kafka using a Reiki Miss ending that simple so it's nothing related to meet me actually here understanding using the emitter but on the other side in the stat service compute some stats it's actually getting the calf gamma cards as a multi and and possessing milites and so on so it's already integrated and this is a stupid way to compute who is going to win heroes and villains and synced that yes that's more less it just can I guess so why so yeah what I got from you to me here now I think like the third time I've seen the explain is i get i get a new thing every time well is it more than just oh I think it's good thing it's pretty simplifying the fluid API or reactive API and that's it right that's what a real boy yeah it's a fluent API for active operations at his network and physically event-driven so I really wanted to show those event witness inside the API and the reason is is that it's been designed around the idea of distributed systems where almost everything is a synchronous because well it's this two bikini so for the network and using advanced met makes sense at least for me a little bit more easier to understand because of failures because of a timeout and sing like that so you don't need a circuit breaker here you can express everything inside with the mid Keaney API and such kind of things I definitely like it so but I always thought we did first not very much like there's something else to it but I like the beauty the fact that it's just about you bake it take director API and make them readable so away and then as a bonus you get this bit more expressive power for ya failure like nothing so that's that's that's really nice and something we ensure is that it's very easy to go from each knee to jax-rs or completion stage things like no doctor is recto alright java yes it's just so so we have converters to go back and forth these different libraries so it's already integrated we all started looking at oh it's going to be integrated into bloom already mention it a little bit like with this awaits and on a multi you can do something like fight that collect not subscribe it's a rebel and actually this is blocking iterable but this is not looking in looms this is not looking the cameras right so it's actually been designed around this this idea already so you're almost ready for the features let's still a few things to to tweak and tune but was there yeah try it in anger if you got the energy or side project you wanna try it in anger I see the limo come on be right is actually trying it for you please give us feedback on the API so we give ourselves feedback you know as part of the team but you know any external feedback would be hugely appreciated because we're trying to find the right balance of usability and compactness in the - especially when you change calls that are defining your pipeline like fight not to be two variables so yeah give feedback go - what could they give the feedback come on once again you can give the feedback on the caucus Minister Murray mutiny project so we have a github project so you open an issues on the lip fingers on the lip and yeah all the feedbacks are the ideas missing operators because we we have actually selected the operators we wanted and sometimes yeah like like last weekend someone's brought something and say oh I truly would like to have expert and Experian one of the operators implemented it we looked at it and yes it smells so we were really taking a an iterative approach from the api's the main debate right now is finding the right balance between having shortcuts on Union multi or having them in what I call groups even groups on an item on failure on completion and so on we are making progress nothing is it's written in the stone yet so just so anyway we the feedback is welcome ideas are welcome and yes the feedback we are right now from non reactive developers is actually good they were able to write what if co-op without necessarily being a very well very knowledgable about reactive about all this world which I understand and I completely agree is totally different from the interactive world so it's already good waiting for us but we want to go a little bit further and yeah and we want to innovate on the API itself not matter on the whole it's management and back pressure and so on so is plenty of walks or runs out in right corner with Java that have done amazing works and yes this can be just almost used as it is okay thank you very much sorry people there is a couple of questions we couldn't attend to there were a bit too specific it just should shoot the question on Europe and that would be sorry Oh should the question on Zoo leap to claim or mention in Clemmie and we can follow up on the conversations also an email on the meaning is if you prefer the a synchronous way of doing things we never said you would answer right away alright thank you everyone and see you know I don't know what subject so it's gonna be a surprise and yeah don't forget to actually subscribe to youtube.com slash quirky style and show us your goodwill and you sir fine my dear PC demos that like to them ready to meet Eenie if you want to see how its integrated in gr PC because that's what is just shifting copies one maybe it was one five thank you
Info
Channel: Quarkusio
Views: 2,954
Rating: undefined out of 5
Keywords: quarkus, java
Id: uTK73fpPznQ
Channel Id: undefined
Length: 69min 39sec (4179 seconds)
Published: Mon Jun 22 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.