SlideShare ist ein Scribd-Unternehmen logo
1 von 45
Drilling the async Library
By :-
SAHIL SAWHNEY
Software Consultant
KNOLDUS SOFTWARE LLP
By :-
SAHIL SAWHNEY
Software Consultant
KNOLDUS SOFTWARE LLP
Agenda
Understanding
● Futures
● Case Study
● Macros
● Demonstration 1
● The async library
● Demonstration 2
Prologue
async library is an asynchronous programming
facility for Scala that offers a direct API for working
with Futures.
It was added in Scala version 2.10 and is
implemented using macros. Its main constructs,
async and await, are inspired by similar constructs
introduced in C# 5.0.
async library is an asynchronous programming
facility for Scala that offers a direct API for working
with Futures.
It was added in Scala version 2.10 and is
implemented using macros. Its main constructs,
async and await, are inspired by similar constructs
introduced in C# 5.0.
CHAPTER - 1
Future
( The What, Why, When, … )
Future
( The What, Why, When, … )
What is a Future?
A Future is a place holder (an imaginary waiting
box) which holds a value that may become
available at some point.
Example :-
Consider a web service that fetch data from a
specified URL and returns a String (time consuming
operation)
How to deal with such a scenario?
A Future is a place holder (an imaginary waiting
box) which holds a value that may become
available at some point.
Example :-
Consider a web service that fetch data from a
specified URL and returns a String (time consuming
operation)
How to deal with such a scenario?
Why Future?
➔One of the most important trait of a programming
language is to be patient for the code segments to
complete their execution asynchronously with
maximum possible parallelism.
➔And we use futures because they facilitates Scala
with ‘the art of being patient and non blocking’.
➔One of the most important trait of a programming
language is to be patient for the code segments to
complete their execution asynchronously with
maximum possible parallelism.
➔And we use futures because they facilitates Scala
with ‘the art of being patient and non blocking’.
Asynchronous and Parallelism
Asynchronous means :-
“Not occurring at the same time.”
- Dictionary.com
"Concurrency is about dealing with lots of things at
once. Parallelism is about doing lots of things at once."
- Rob Pike
➔In true parallelism you need at least two cores and
the threads need to both be executing at the same
time.
Asynchronous means :-
“Not occurring at the same time.”
- Dictionary.com
"Concurrency is about dealing with lots of things at
once. Parallelism is about doing lots of things at once."
- Rob Pike
➔In true parallelism you need at least two cores and
the threads need to both be executing at the same
time.
When do we use Future?
The operations which may take time (like I/O) to
execute are enclosed under the Future scope which
starts asynchronous computation and returns a
Future value holding the result of the computation.
We said that Future is an imaginary waiting box, so
how to access the resultant value from this box?
The operations which may take time (like I/O) to
execute are enclosed under the Future scope which
starts asynchronous computation and returns a
Future value holding the result of the computation.
We said that Future is an imaginary waiting box, so
how to access the resultant value from this box?
Access result of Future
Access result of Future cont...
The result (value or exception) from a Future can
be accessed by following ways :-
1). Callbacks
2). Combinators
3). For Comprehensive
4). Await.result
5). The async library (async,await)
Callbacks
a). onComplete ->
Callbacks cont..
b). onSuccess ->
c). onFailure ->
Combinators
Combinators like map, flatMap are used to transform
a future value to a resultant future value.
Combinators like map, flatMap are used to transform
a future value to a resultant future value.
Any problem in the above
code ?
Combinators cont..
Combinators like recover, recoverWith are used to
handle the exception which may occur while
accessing the value of a future.
Combinators like recover, recoverWith are used to
handle the exception which may occur while
accessing the value of a future.
Applying recover combinator
For Comprehensive
It is most commonly used in scenarios where we
need multiple Future values to compute a result
which is further a Future value.
It is most commonly used in scenarios where we
need multiple Future values to compute a result
which is further a Future value.
Await.result
Internally Await use blocking and yields the result of
associated Future by blocking the current thread,
thus killing the asynchronous approach to code.
Hence, It Await should only be used in test cases.
Internally Await use blocking and yields the result of
associated Future by blocking the current thread,
thus killing the asynchronous approach to code.
Hence, It Await should only be used in test cases.
CHAPTER - 2
Macro
( What kind of sorcery is this? )
Macro
( What kind of sorcery is this? )
What is macro?
➔In Scala macros are a way to implement compile
time reflection.
➔These are ‘special functions’ as using macros we
can access the compiler API’s (using the context)
which provide us with the privilege to manage the
AST(Abstract Syntax Tree) generated by the
compiler.
➔AST is a data structure used by the Scala compiler
to store the information about the compiled code
➔In Scala macros are a way to implement compile
time reflection.
➔These are ‘special functions’ as using macros we
can access the compiler API’s (using the context)
which provide us with the privilege to manage the
AST(Abstract Syntax Tree) generated by the
compiler.
➔AST is a data structure used by the Scala compiler
to store the information about the compiled code
Why macro?
Macros give programmer the power to :-
➔Inspecting type of an object, including generic type
(Traversing, inspecting the AST)
➔Creating new objects.(Appending the AST with new
child)
➔Access the member function of the
object(Accessing the child nodes in AST)
Macros give programmer the power to :-
➔Inspecting type of an object, including generic type
(Traversing, inspecting the AST)
➔Creating new objects.(Appending the AST with new
child)
➔Access the member function of the
object(Accessing the child nodes in AST)
When to use macro?
Macro(The reflection cousin) is used when we have
to performs the following operations:
➔Introspection: Program can examine itself.
➔Intercession: Program can modify its
state/meaning.
Macro(The reflection cousin) is used when we have
to performs the following operations:
➔Introspection: Program can examine itself.
➔Intercession: Program can modify its
state/meaning.
Declaring a macro definition
def add(num1:Int, num2:Int):Int = macro addImpl
Here,
‘add’ is the name of the method
‘num1, num2’ is the parameter of type ’Int’
‘Int’ is the return type of ‘add’
‘macro’ is the keyword
‘addImpl’ is another method which provide the implementation for macro
Implementing a macro
Macro implementation is a method which defines the
functionality of macro.
It is a bit different from the normal methods in a way
that the macro implementation work on AST and is
called at the compile time (by compiler) with AST of
the parameters rather than the parameter itself and
also returns an AST of its return value.
Macro implementation is a method which defines the
functionality of macro.
It is a bit different from the normal methods in a way
that the macro implementation work on AST and is
called at the compile time (by compiler) with AST of
the parameters rather than the parameter itself and
also returns an AST of its return value.
Reify, Splice!!! Whats that?
Macros implementation method returns an AST and
this is achieved using the ‘reify’ and ‘splice’ method.
a). reify() – The ‘reify’ method is in itself a macro
which turns the code enclosed in its scope into its
corresponding AST and type.
b). splice() – The ‘splice’ method is a programmatic
antonym of ‘reify’ as it turns the AST into a value with
corresponding type. It can only be used inside the
scope of ‘reify’.
Macros implementation method returns an AST and
this is achieved using the ‘reify’ and ‘splice’ method.
a). reify() – The ‘reify’ method is in itself a macro
which turns the code enclosed in its scope into its
corresponding AST and type.
b). splice() – The ‘splice’ method is a programmatic
antonym of ‘reify’ as it turns the AST into a value with
corresponding type. It can only be used inside the
scope of ‘reify’.
The compiler magic
Let us now understand the sequence of events that
occur when the compiler encounters a macro.
Firstly, Call to macro implementation transforms in
following way :-
def add(num1:Int, num2:Int):Int = macro addImpl
Bold part is converted to :-
addImpl(c)(AST < 2 >, AST < 1 >)
Here, 2 and 1 are the parameters to macro(operands
to be added) and ‘AST<2>’ = ‘Literal(Constant(2))’
Let us now understand the sequence of events that
occur when the compiler encounters a macro.
Firstly, Call to macro implementation transforms in
following way :-
def add(num1:Int, num2:Int):Int = macro addImpl
Bold part is converted to :-
addImpl(c)(AST < 2 >, AST < 1 >)
Here, 2 and 1 are the parameters to macro(operands
to be added) and ‘AST<2>’ = ‘Literal(Constant(2))’
The compiler magic cont..
Secondly, the return value of macro implementation
which in itself is an AST(with a type) gets inlined to
the AST of the main program and is type checked in
turn.
In other words, the macro declaration acts as the part
of main AST to which the AST of the returned value of
macro implementation is attached.
Secondly, the return value of macro implementation
which in itself is an AST(with a type) gets inlined to
the AST of the main program and is type checked in
turn.
In other words, the macro declaration acts as the part
of main AST to which the AST of the returned value of
macro implementation is attached.
A very important note
Call to a macro can not be present in same ‘.scala
file’ in which the macro and its implementation are
present because the .scala file containing the code
for macro implementation must be compiled first.
Call to a macro can not be present in same ‘.scala
file’ in which the macro and its implementation are
present because the .scala file containing the code
for macro implementation must be compiled first.
CHAPTER - 3
Async library
( Finally :D )
Async library
( Finally :D )
What is an async Library?
➔ async library can be considered as another
alternative of low-level callbacks or high order
functions like map and flat-map and is used to
access the result of the future.
➔ Internally the async library is implemented using
callbacks, our beloved macros and needs an
ExecutionContext for code execution.
➔ It has Async object with only two methods
namely ‘async()’ and ‘await()’
The async method
➔Marks the beginning of the asynchronous code
block
➔The execution of the code enclosed in async scope
is execute on a thread from the thread pool.
➔ Inside the async scope we generally call the time
consuming operations like call to a web service,
fetching content of the file, fetching data from the
databases like elastic search etc.
➔Marks the beginning of the asynchronous code
block
➔The execution of the code enclosed in async scope
is execute on a thread from the thread pool.
➔ Inside the async scope we generally call the time
consuming operations like call to a web service,
fetching content of the file, fetching data from the
databases like elastic search etc.
The await method
➔As the name suggests, this method waits for a
future to complete its execution.
➔It can only be used inside a ‘async’ block but with
some limitations
➔The call to ‘await’ method are translated into the call
to ‘onComplete’ of the associated Future by the
async macro
➔As the name suggests, this method waits for a
future to complete its execution.
➔It can only be used inside a ‘async’ block but with
some limitations
➔The call to ‘await’ method are translated into the call
to ‘onComplete’ of the associated Future by the
async macro
Why use async library?
➔Increase the readability and simplicity of code.
➔Reduces code complexity for the programmer.
➔Increase the readability and simplicity of code.
➔Reduces code complexity for the programmer.
When to use async library?
When we want to access the value of a future in a
non blocking way.
Since the documentation of the async library is
marked with improvement process, it has quite
some limitations.
When we want to access the value of a future in a
non blocking way.
Since the documentation of the async library is
marked with improvement process, it has quite
some limitations.
Limitations of async library?
➔‘await’ requires a directly enclosing ‘async’ block
➔‘await’ can not be used inside a nested object, trait,
or class inside ‘async’
➔ ‘await’ must not be used inside a Boolean short-
circuit argument
➔Return expressions are illegal inside an ‘async’
block.
➔‘await’ requires a directly enclosing ‘async’ block
➔‘await’ can not be used inside a nested object, trait,
or class inside ‘async’
➔ ‘await’ must not be used inside a Boolean short-
circuit argument
➔Return expressions are illegal inside an ‘async’
block.
The code transformations
The code inside the async scope undergoes two
levels of transformation
In first phase, code is normalized to a form that can
further be transformed into a state machine.
In second phase, normalized code is transformed
into state machine
The code inside the async scope undergoes two
levels of transformation
In first phase, code is normalized to a form that can
further be transformed into a state machine.
In second phase, normalized code is transformed
into state machine
‘A-Normal Form'(ANF)
transformation
Following changes happen at phase one
➔All control flow constructs like ‘if’ and ‘match’ are
transformed from expression to statements and
there results are stored in compiler fabricated
variable.
➔All the calls to the ‘await’ methods are removed
from the code and instead compiler fabricated
variables are used to store their result.
Following changes happen at phase one
➔All control flow constructs like ‘if’ and ‘match’ are
transformed from expression to statements and
there results are stored in compiler fabricated
variable.
➔All the calls to the ‘await’ methods are removed
from the code and instead compiler fabricated
variables are used to store their result.
Full Async Transformation
(State machine code)
The code associated with the full async
transformation is compiler synthesised and is not
discussed in details here(litle bit of abstarction is
always welcomed :p)
Finally, Corresponding bytecode for the state
machine code is generated at the end of the
compilation process.
The code associated with the full async
transformation is compiler synthesised and is not
discussed in details here(litle bit of abstarction is
always welcomed :p)
Finally, Corresponding bytecode for the state
machine code is generated at the end of the
compilation process.
A very important note
Call to a macro can not be present in same ‘.scala
file’ in which the macro and its implementation are
present because the .scala file containing the code
for macro implementation must be compiled first.
Call to a macro can not be present in same ‘.scala
file’ in which the macro and its implementation are
present because the .scala file containing the code
for macro implementation must be compiled first.
Summing up
At COMPILE time ->
The code marked under the async scope is
transformed into its corresponding compiler
synthesized state machine code by the ‘asyncImpl’
macro implementation method of the ‘async’ macro
from which the byte-code is generated at the end of
the compilation process.
At COMPILE time ->
The code marked under the async scope is
transformed into its corresponding compiler
synthesized state machine code by the ‘asyncImpl’
macro implementation method of the ‘async’ macro
from which the byte-code is generated at the end of
the compilation process.
Summing up cont..
At Run time ->
As the byte-code corresponding to the async block
is approached for its execution, a thread from the
thread-pool(remember the EcecutionContext) is
assigned to it and the execution takes place
asynchronously.
At Run time ->
As the byte-code corresponding to the async block
is approached for its execution, a thread from the
thread-pool(remember the EcecutionContext) is
assigned to it and the execution takes place
asynchronously.
Important note
The async scope in itself is asynchronous but the
execution inside this scope is synchronous.
The async scope in itself is asynchronous but the
execution inside this scope is synchronous.
Demonstration →
https://github.com/knoldus/async-await-example
References
http://docs.scala-lang.org/sips/pending/async.html
http://docs.scala-lang.org/overviews/reflection/overview
http://docs.scala-lang.org/overviews/macros/overview.h
https://blog.knoldus.com/2016/07/13/the-async-library-i
http://docs.scala-lang.org/sips/pending/async.html
http://docs.scala-lang.org/overviews/reflection/overview
http://docs.scala-lang.org/overviews/macros/overview.h
https://blog.knoldus.com/2016/07/13/the-async-library-i
Any Questions?
Arigato Gozaimasu !!!

Weitere ähnliche Inhalte

Was ist angesagt?

What To Leave Implicit
What To Leave ImplicitWhat To Leave Implicit
What To Leave ImplicitMartin Odersky
 
The Why and How of Scala at Twitter
The Why and How of Scala at TwitterThe Why and How of Scala at Twitter
The Why and How of Scala at TwitterAlex Payne
 
Martin Odersky - Evolution of Scala
Martin Odersky - Evolution of ScalaMartin Odersky - Evolution of Scala
Martin Odersky - Evolution of ScalaScala Italy
 
Understanding Akka Streams, Back Pressure, and Asynchronous Architectures
Understanding Akka Streams, Back Pressure, and Asynchronous ArchitecturesUnderstanding Akka Streams, Back Pressure, and Asynchronous Architectures
Understanding Akka Streams, Back Pressure, and Asynchronous ArchitecturesLightbend
 
Spark real world use cases and optimizations
Spark real world use cases and optimizationsSpark real world use cases and optimizations
Spark real world use cases and optimizationsGal Marder
 
The Dark Side Of Lambda Expressions in Java 8
The Dark Side Of Lambda Expressions in Java 8The Dark Side Of Lambda Expressions in Java 8
The Dark Side Of Lambda Expressions in Java 8Takipi
 
Testing Spark and Scala
Testing Spark and ScalaTesting Spark and Scala
Testing Spark and Scaladatamantra
 
Stream processing from single node to a cluster
Stream processing from single node to a clusterStream processing from single node to a cluster
Stream processing from single node to a clusterGal Marder
 
Building an aws sdk for Perl - Granada Perl Workshop 2014
Building an aws sdk for Perl - Granada Perl Workshop 2014Building an aws sdk for Perl - Granada Perl Workshop 2014
Building an aws sdk for Perl - Granada Perl Workshop 2014Jose Luis Martínez
 
JVM languages "flame wars"
JVM languages "flame wars"JVM languages "flame wars"
JVM languages "flame wars"Gal Marder
 
Introduction to Scala | Big Data Hadoop Spark Tutorial | CloudxLab
Introduction to Scala | Big Data Hadoop Spark Tutorial | CloudxLabIntroduction to Scala | Big Data Hadoop Spark Tutorial | CloudxLab
Introduction to Scala | Big Data Hadoop Spark Tutorial | CloudxLabCloudxLab
 
Dive into spark2
Dive into spark2Dive into spark2
Dive into spark2Gal Marder
 
Paws - Perl AWS SDK Update - November 2015
Paws - Perl AWS SDK Update - November 2015Paws - Perl AWS SDK Update - November 2015
Paws - Perl AWS SDK Update - November 2015Jose Luis Martínez
 
Concurrency in Scala - the Akka way
Concurrency in Scala - the Akka wayConcurrency in Scala - the Akka way
Concurrency in Scala - the Akka wayYardena Meymann
 
A Scala tutorial
A Scala tutorialA Scala tutorial
A Scala tutorialDima Statz
 
Scala Days San Francisco
Scala Days San FranciscoScala Days San Francisco
Scala Days San FranciscoMartin Odersky
 
Scala final ppt vinay
Scala final ppt vinayScala final ppt vinay
Scala final ppt vinayViplav Jain
 
Paws: A Perl AWS SDK - YAPC Europe 2015
Paws: A Perl AWS SDK - YAPC Europe 2015Paws: A Perl AWS SDK - YAPC Europe 2015
Paws: A Perl AWS SDK - YAPC Europe 2015CAPSiDE
 

Was ist angesagt? (20)

What To Leave Implicit
What To Leave ImplicitWhat To Leave Implicit
What To Leave Implicit
 
The Why and How of Scala at Twitter
The Why and How of Scala at TwitterThe Why and How of Scala at Twitter
The Why and How of Scala at Twitter
 
Martin Odersky - Evolution of Scala
Martin Odersky - Evolution of ScalaMartin Odersky - Evolution of Scala
Martin Odersky - Evolution of Scala
 
Understanding Akka Streams, Back Pressure, and Asynchronous Architectures
Understanding Akka Streams, Back Pressure, and Asynchronous ArchitecturesUnderstanding Akka Streams, Back Pressure, and Asynchronous Architectures
Understanding Akka Streams, Back Pressure, and Asynchronous Architectures
 
Spark real world use cases and optimizations
Spark real world use cases and optimizationsSpark real world use cases and optimizations
Spark real world use cases and optimizations
 
The Dark Side Of Lambda Expressions in Java 8
The Dark Side Of Lambda Expressions in Java 8The Dark Side Of Lambda Expressions in Java 8
The Dark Side Of Lambda Expressions in Java 8
 
Testing Spark and Scala
Testing Spark and ScalaTesting Spark and Scala
Testing Spark and Scala
 
Stream processing from single node to a cluster
Stream processing from single node to a clusterStream processing from single node to a cluster
Stream processing from single node to a cluster
 
Building an aws sdk for Perl - Granada Perl Workshop 2014
Building an aws sdk for Perl - Granada Perl Workshop 2014Building an aws sdk for Perl - Granada Perl Workshop 2014
Building an aws sdk for Perl - Granada Perl Workshop 2014
 
JVM languages "flame wars"
JVM languages "flame wars"JVM languages "flame wars"
JVM languages "flame wars"
 
Introduction to Scala | Big Data Hadoop Spark Tutorial | CloudxLab
Introduction to Scala | Big Data Hadoop Spark Tutorial | CloudxLabIntroduction to Scala | Big Data Hadoop Spark Tutorial | CloudxLab
Introduction to Scala | Big Data Hadoop Spark Tutorial | CloudxLab
 
Dive into spark2
Dive into spark2Dive into spark2
Dive into spark2
 
Introduction to Scala
Introduction to ScalaIntroduction to Scala
Introduction to Scala
 
Paws - Perl AWS SDK Update - November 2015
Paws - Perl AWS SDK Update - November 2015Paws - Perl AWS SDK Update - November 2015
Paws - Perl AWS SDK Update - November 2015
 
Concurrency in Scala - the Akka way
Concurrency in Scala - the Akka wayConcurrency in Scala - the Akka way
Concurrency in Scala - the Akka way
 
Paws - A Perl AWS SDK
Paws - A Perl AWS SDKPaws - A Perl AWS SDK
Paws - A Perl AWS SDK
 
A Scala tutorial
A Scala tutorialA Scala tutorial
A Scala tutorial
 
Scala Days San Francisco
Scala Days San FranciscoScala Days San Francisco
Scala Days San Francisco
 
Scala final ppt vinay
Scala final ppt vinayScala final ppt vinay
Scala final ppt vinay
 
Paws: A Perl AWS SDK - YAPC Europe 2015
Paws: A Perl AWS SDK - YAPC Europe 2015Paws: A Perl AWS SDK - YAPC Europe 2015
Paws: A Perl AWS SDK - YAPC Europe 2015
 

Andere mochten auch

Getting Started With AureliaJs
Getting Started With AureliaJsGetting Started With AureliaJs
Getting Started With AureliaJsKnoldus Inc.
 
Introduction to Scala JS
Introduction to Scala JSIntroduction to Scala JS
Introduction to Scala JSKnoldus Inc.
 
String interpolation
String interpolationString interpolation
String interpolationKnoldus Inc.
 
Realm Mobile Database - An Introduction
Realm Mobile Database - An IntroductionRealm Mobile Database - An Introduction
Realm Mobile Database - An IntroductionKnoldus Inc.
 
Mailchimp and Mandrill - The ‘Hominidae’ kingdom
Mailchimp and Mandrill - The ‘Hominidae’ kingdomMailchimp and Mandrill - The ‘Hominidae’ kingdom
Mailchimp and Mandrill - The ‘Hominidae’ kingdomKnoldus Inc.
 
Shapeless- Generic programming for Scala
Shapeless- Generic programming for ScalaShapeless- Generic programming for Scala
Shapeless- Generic programming for ScalaKnoldus Inc.
 
Introduction to Java 8
Introduction to Java 8Introduction to Java 8
Introduction to Java 8Knoldus Inc.
 
Introduction to Scala Macros
Introduction to Scala MacrosIntroduction to Scala Macros
Introduction to Scala MacrosKnoldus Inc.
 
An Introduction to Quill
An Introduction to QuillAn Introduction to Quill
An Introduction to QuillKnoldus Inc.
 
Mandrill Templates
Mandrill TemplatesMandrill Templates
Mandrill TemplatesKnoldus Inc.
 
ANTLR4 and its testing
ANTLR4 and its testingANTLR4 and its testing
ANTLR4 and its testingKnoldus Inc.
 
Functors, Applicatives and Monads In Scala
Functors, Applicatives and Monads In ScalaFunctors, Applicatives and Monads In Scala
Functors, Applicatives and Monads In ScalaKnoldus Inc.
 
Introduction to Knockout Js
Introduction to Knockout JsIntroduction to Knockout Js
Introduction to Knockout JsKnoldus Inc.
 
Effective way to code in Scala
Effective way to code in ScalaEffective way to code in Scala
Effective way to code in ScalaKnoldus Inc.
 
Functional programming in Javascript
Functional programming in JavascriptFunctional programming in Javascript
Functional programming in JavascriptKnoldus Inc.
 
HTML5, CSS, JavaScript Style guide and coding conventions
HTML5, CSS, JavaScript Style guide and coding conventionsHTML5, CSS, JavaScript Style guide and coding conventions
HTML5, CSS, JavaScript Style guide and coding conventionsKnoldus Inc.
 
MongoDB: Advance concepts - Replication and Sharding
MongoDB: Advance concepts - Replication and ShardingMongoDB: Advance concepts - Replication and Sharding
MongoDB: Advance concepts - Replication and ShardingKnoldus Inc.
 
Introduction to Apache Cassandra
Introduction to Apache Cassandra Introduction to Apache Cassandra
Introduction to Apache Cassandra Knoldus Inc.
 

Andere mochten auch (20)

Getting Started With AureliaJs
Getting Started With AureliaJsGetting Started With AureliaJs
Getting Started With AureliaJs
 
Introduction to Scala JS
Introduction to Scala JSIntroduction to Scala JS
Introduction to Scala JS
 
Akka streams
Akka streamsAkka streams
Akka streams
 
String interpolation
String interpolationString interpolation
String interpolation
 
Realm Mobile Database - An Introduction
Realm Mobile Database - An IntroductionRealm Mobile Database - An Introduction
Realm Mobile Database - An Introduction
 
Mailchimp and Mandrill - The ‘Hominidae’ kingdom
Mailchimp and Mandrill - The ‘Hominidae’ kingdomMailchimp and Mandrill - The ‘Hominidae’ kingdom
Mailchimp and Mandrill - The ‘Hominidae’ kingdom
 
Kanban
KanbanKanban
Kanban
 
Shapeless- Generic programming for Scala
Shapeless- Generic programming for ScalaShapeless- Generic programming for Scala
Shapeless- Generic programming for Scala
 
Introduction to Java 8
Introduction to Java 8Introduction to Java 8
Introduction to Java 8
 
Introduction to Scala Macros
Introduction to Scala MacrosIntroduction to Scala Macros
Introduction to Scala Macros
 
An Introduction to Quill
An Introduction to QuillAn Introduction to Quill
An Introduction to Quill
 
Mandrill Templates
Mandrill TemplatesMandrill Templates
Mandrill Templates
 
ANTLR4 and its testing
ANTLR4 and its testingANTLR4 and its testing
ANTLR4 and its testing
 
Functors, Applicatives and Monads In Scala
Functors, Applicatives and Monads In ScalaFunctors, Applicatives and Monads In Scala
Functors, Applicatives and Monads In Scala
 
Introduction to Knockout Js
Introduction to Knockout JsIntroduction to Knockout Js
Introduction to Knockout Js
 
Effective way to code in Scala
Effective way to code in ScalaEffective way to code in Scala
Effective way to code in Scala
 
Functional programming in Javascript
Functional programming in JavascriptFunctional programming in Javascript
Functional programming in Javascript
 
HTML5, CSS, JavaScript Style guide and coding conventions
HTML5, CSS, JavaScript Style guide and coding conventionsHTML5, CSS, JavaScript Style guide and coding conventions
HTML5, CSS, JavaScript Style guide and coding conventions
 
MongoDB: Advance concepts - Replication and Sharding
MongoDB: Advance concepts - Replication and ShardingMongoDB: Advance concepts - Replication and Sharding
MongoDB: Advance concepts - Replication and Sharding
 
Introduction to Apache Cassandra
Introduction to Apache Cassandra Introduction to Apache Cassandra
Introduction to Apache Cassandra
 

Ähnlich wie Drilling the Async Library

Why scala is not my ideal language and what I can do with this
Why scala is not my ideal language and what I can do with thisWhy scala is not my ideal language and what I can do with this
Why scala is not my ideal language and what I can do with thisRuslan Shevchenko
 
PART-3 : Mastering RTOS FreeRTOS and STM32Fx with Debugging
PART-3 : Mastering RTOS FreeRTOS and STM32Fx with DebuggingPART-3 : Mastering RTOS FreeRTOS and STM32Fx with Debugging
PART-3 : Mastering RTOS FreeRTOS and STM32Fx with DebuggingFastBit Embedded Brain Academy
 
Build Real-Time Streaming ETL Pipelines With Akka Streams, Alpakka And Apache...
Build Real-Time Streaming ETL Pipelines With Akka Streams, Alpakka And Apache...Build Real-Time Streaming ETL Pipelines With Akka Streams, Alpakka And Apache...
Build Real-Time Streaming ETL Pipelines With Akka Streams, Alpakka And Apache...Lightbend
 
Bytecode manipulation with Javassist for fun and profit
Bytecode manipulation with Javassist for fun and profitBytecode manipulation with Javassist for fun and profit
Bytecode manipulation with Javassist for fun and profitJérôme Kehrli
 
Stream-Native Processing with Pulsar Functions
Stream-Native Processing with Pulsar FunctionsStream-Native Processing with Pulsar Functions
Stream-Native Processing with Pulsar FunctionsStreamlio
 
Deploying MLlib for Scoring in Structured Streaming with Joseph Bradley
Deploying MLlib for Scoring in Structured Streaming with Joseph BradleyDeploying MLlib for Scoring in Structured Streaming with Joseph Bradley
Deploying MLlib for Scoring in Structured Streaming with Joseph BradleyDatabricks
 
scala.reflect, Eugene Burmako
scala.reflect, Eugene Burmakoscala.reflect, Eugene Burmako
scala.reflect, Eugene BurmakoVasil Remeniuk
 
Евгений Бурмако «scala.reflect»
Евгений Бурмако «scala.reflect»Евгений Бурмако «scala.reflect»
Евгений Бурмако «scala.reflect»e-Legion
 
Java 8 - A step closer to Parallelism
Java 8 - A step closer to ParallelismJava 8 - A step closer to Parallelism
Java 8 - A step closer to Parallelismjbugkorea
 
The Evolution of Async-Programming on .NET Platform (.Net China, C#)
The Evolution of Async-Programming on .NET Platform (.Net China, C#)The Evolution of Async-Programming on .NET Platform (.Net China, C#)
The Evolution of Async-Programming on .NET Platform (.Net China, C#)jeffz
 
Scala lens: An introduction
Scala lens: An introductionScala lens: An introduction
Scala lens: An introductionKnoldus Inc.
 
End to End Akka Streams / Reactive Streams - from Business to Socket
End to End Akka Streams / Reactive Streams - from Business to SocketEnd to End Akka Streams / Reactive Streams - from Business to Socket
End to End Akka Streams / Reactive Streams - from Business to SocketKonrad Malawski
 
Porting a Streaming Pipeline from Scala to Rust
Porting a Streaming Pipeline from Scala to RustPorting a Streaming Pipeline from Scala to Rust
Porting a Streaming Pipeline from Scala to RustEvan Chan
 
Reactive programming with rx java
Reactive programming with rx javaReactive programming with rx java
Reactive programming with rx javaCongTrung Vnit
 
How to Reverse Engineer Web Applications
How to Reverse Engineer Web ApplicationsHow to Reverse Engineer Web Applications
How to Reverse Engineer Web ApplicationsJarrod Overson
 

Ähnlich wie Drilling the Async Library (20)

Why scala is not my ideal language and what I can do with this
Why scala is not my ideal language and what I can do with thisWhy scala is not my ideal language and what I can do with this
Why scala is not my ideal language and what I can do with this
 
PART-3 : Mastering RTOS FreeRTOS and STM32Fx with Debugging
PART-3 : Mastering RTOS FreeRTOS and STM32Fx with DebuggingPART-3 : Mastering RTOS FreeRTOS and STM32Fx with Debugging
PART-3 : Mastering RTOS FreeRTOS and STM32Fx with Debugging
 
Devoxx
DevoxxDevoxx
Devoxx
 
Build Real-Time Streaming ETL Pipelines With Akka Streams, Alpakka And Apache...
Build Real-Time Streaming ETL Pipelines With Akka Streams, Alpakka And Apache...Build Real-Time Streaming ETL Pipelines With Akka Streams, Alpakka And Apache...
Build Real-Time Streaming ETL Pipelines With Akka Streams, Alpakka And Apache...
 
Bytecode manipulation with Javassist for fun and profit
Bytecode manipulation with Javassist for fun and profitBytecode manipulation with Javassist for fun and profit
Bytecode manipulation with Javassist for fun and profit
 
React native
React nativeReact native
React native
 
js.pptx
js.pptxjs.pptx
js.pptx
 
RxJava@Android
RxJava@AndroidRxJava@Android
RxJava@Android
 
Stream-Native Processing with Pulsar Functions
Stream-Native Processing with Pulsar FunctionsStream-Native Processing with Pulsar Functions
Stream-Native Processing with Pulsar Functions
 
Deploying MLlib for Scoring in Structured Streaming with Joseph Bradley
Deploying MLlib for Scoring in Structured Streaming with Joseph BradleyDeploying MLlib for Scoring in Structured Streaming with Joseph Bradley
Deploying MLlib for Scoring in Structured Streaming with Joseph Bradley
 
scala.reflect, Eugene Burmako
scala.reflect, Eugene Burmakoscala.reflect, Eugene Burmako
scala.reflect, Eugene Burmako
 
Евгений Бурмако «scala.reflect»
Евгений Бурмако «scala.reflect»Евгений Бурмако «scala.reflect»
Евгений Бурмако «scala.reflect»
 
Java 8 - A step closer to Parallelism
Java 8 - A step closer to ParallelismJava 8 - A step closer to Parallelism
Java 8 - A step closer to Parallelism
 
JavaScript for real men
JavaScript for real menJavaScript for real men
JavaScript for real men
 
The Evolution of Async-Programming on .NET Platform (.Net China, C#)
The Evolution of Async-Programming on .NET Platform (.Net China, C#)The Evolution of Async-Programming on .NET Platform (.Net China, C#)
The Evolution of Async-Programming on .NET Platform (.Net China, C#)
 
Scala lens: An introduction
Scala lens: An introductionScala lens: An introduction
Scala lens: An introduction
 
End to End Akka Streams / Reactive Streams - from Business to Socket
End to End Akka Streams / Reactive Streams - from Business to SocketEnd to End Akka Streams / Reactive Streams - from Business to Socket
End to End Akka Streams / Reactive Streams - from Business to Socket
 
Porting a Streaming Pipeline from Scala to Rust
Porting a Streaming Pipeline from Scala to RustPorting a Streaming Pipeline from Scala to Rust
Porting a Streaming Pipeline from Scala to Rust
 
Reactive programming with rx java
Reactive programming with rx javaReactive programming with rx java
Reactive programming with rx java
 
How to Reverse Engineer Web Applications
How to Reverse Engineer Web ApplicationsHow to Reverse Engineer Web Applications
How to Reverse Engineer Web Applications
 

Mehr von Knoldus Inc.

Mastering Web Scraping with JSoup Unlocking the Secrets of HTML Parsing
Mastering Web Scraping with JSoup Unlocking the Secrets of HTML ParsingMastering Web Scraping with JSoup Unlocking the Secrets of HTML Parsing
Mastering Web Scraping with JSoup Unlocking the Secrets of HTML ParsingKnoldus Inc.
 
Akka gRPC Essentials A Hands-On Introduction
Akka gRPC Essentials A Hands-On IntroductionAkka gRPC Essentials A Hands-On Introduction
Akka gRPC Essentials A Hands-On IntroductionKnoldus Inc.
 
Entity Core with Core Microservices.pptx
Entity Core with Core Microservices.pptxEntity Core with Core Microservices.pptx
Entity Core with Core Microservices.pptxKnoldus Inc.
 
Introduction to Redis and its features.pptx
Introduction to Redis and its features.pptxIntroduction to Redis and its features.pptx
Introduction to Redis and its features.pptxKnoldus Inc.
 
GraphQL with .NET Core Microservices.pdf
GraphQL with .NET Core Microservices.pdfGraphQL with .NET Core Microservices.pdf
GraphQL with .NET Core Microservices.pdfKnoldus Inc.
 
NuGet Packages Presentation (DoT NeT).pptx
NuGet Packages Presentation (DoT NeT).pptxNuGet Packages Presentation (DoT NeT).pptx
NuGet Packages Presentation (DoT NeT).pptxKnoldus Inc.
 
Data Quality in Test Automation Navigating the Path to Reliable Testing
Data Quality in Test Automation Navigating the Path to Reliable TestingData Quality in Test Automation Navigating the Path to Reliable Testing
Data Quality in Test Automation Navigating the Path to Reliable TestingKnoldus Inc.
 
K8sGPTThe AI​ way to diagnose Kubernetes
K8sGPTThe AI​ way to diagnose KubernetesK8sGPTThe AI​ way to diagnose Kubernetes
K8sGPTThe AI​ way to diagnose KubernetesKnoldus Inc.
 
Introduction to Circle Ci Presentation.pptx
Introduction to Circle Ci Presentation.pptxIntroduction to Circle Ci Presentation.pptx
Introduction to Circle Ci Presentation.pptxKnoldus Inc.
 
Robusta -Tool Presentation (DevOps).pptx
Robusta -Tool Presentation (DevOps).pptxRobusta -Tool Presentation (DevOps).pptx
Robusta -Tool Presentation (DevOps).pptxKnoldus Inc.
 
Optimizing Kubernetes using GOLDILOCKS.pptx
Optimizing Kubernetes using GOLDILOCKS.pptxOptimizing Kubernetes using GOLDILOCKS.pptx
Optimizing Kubernetes using GOLDILOCKS.pptxKnoldus Inc.
 
Azure Function App Exception Handling.pptx
Azure Function App Exception Handling.pptxAzure Function App Exception Handling.pptx
Azure Function App Exception Handling.pptxKnoldus Inc.
 
CQRS Design Pattern Presentation (Java).pptx
CQRS Design Pattern Presentation (Java).pptxCQRS Design Pattern Presentation (Java).pptx
CQRS Design Pattern Presentation (Java).pptxKnoldus Inc.
 
ETL Observability: Azure to Snowflake Presentation
ETL Observability: Azure to Snowflake PresentationETL Observability: Azure to Snowflake Presentation
ETL Observability: Azure to Snowflake PresentationKnoldus Inc.
 
Scripting with K6 - Beyond the Basics Presentation
Scripting with K6 - Beyond the Basics PresentationScripting with K6 - Beyond the Basics Presentation
Scripting with K6 - Beyond the Basics PresentationKnoldus Inc.
 
Getting started with dotnet core Web APIs
Getting started with dotnet core Web APIsGetting started with dotnet core Web APIs
Getting started with dotnet core Web APIsKnoldus Inc.
 
Introduction To Rust part II Presentation
Introduction To Rust part II PresentationIntroduction To Rust part II Presentation
Introduction To Rust part II PresentationKnoldus Inc.
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationKnoldus Inc.
 
Configuring Workflows & Validators in JIRA
Configuring Workflows & Validators in JIRAConfiguring Workflows & Validators in JIRA
Configuring Workflows & Validators in JIRAKnoldus Inc.
 
Advanced Python (with dependency injection and hydra configuration packages)
Advanced Python (with dependency injection and hydra configuration packages)Advanced Python (with dependency injection and hydra configuration packages)
Advanced Python (with dependency injection and hydra configuration packages)Knoldus Inc.
 

Mehr von Knoldus Inc. (20)

Mastering Web Scraping with JSoup Unlocking the Secrets of HTML Parsing
Mastering Web Scraping with JSoup Unlocking the Secrets of HTML ParsingMastering Web Scraping with JSoup Unlocking the Secrets of HTML Parsing
Mastering Web Scraping with JSoup Unlocking the Secrets of HTML Parsing
 
Akka gRPC Essentials A Hands-On Introduction
Akka gRPC Essentials A Hands-On IntroductionAkka gRPC Essentials A Hands-On Introduction
Akka gRPC Essentials A Hands-On Introduction
 
Entity Core with Core Microservices.pptx
Entity Core with Core Microservices.pptxEntity Core with Core Microservices.pptx
Entity Core with Core Microservices.pptx
 
Introduction to Redis and its features.pptx
Introduction to Redis and its features.pptxIntroduction to Redis and its features.pptx
Introduction to Redis and its features.pptx
 
GraphQL with .NET Core Microservices.pdf
GraphQL with .NET Core Microservices.pdfGraphQL with .NET Core Microservices.pdf
GraphQL with .NET Core Microservices.pdf
 
NuGet Packages Presentation (DoT NeT).pptx
NuGet Packages Presentation (DoT NeT).pptxNuGet Packages Presentation (DoT NeT).pptx
NuGet Packages Presentation (DoT NeT).pptx
 
Data Quality in Test Automation Navigating the Path to Reliable Testing
Data Quality in Test Automation Navigating the Path to Reliable TestingData Quality in Test Automation Navigating the Path to Reliable Testing
Data Quality in Test Automation Navigating the Path to Reliable Testing
 
K8sGPTThe AI​ way to diagnose Kubernetes
K8sGPTThe AI​ way to diagnose KubernetesK8sGPTThe AI​ way to diagnose Kubernetes
K8sGPTThe AI​ way to diagnose Kubernetes
 
Introduction to Circle Ci Presentation.pptx
Introduction to Circle Ci Presentation.pptxIntroduction to Circle Ci Presentation.pptx
Introduction to Circle Ci Presentation.pptx
 
Robusta -Tool Presentation (DevOps).pptx
Robusta -Tool Presentation (DevOps).pptxRobusta -Tool Presentation (DevOps).pptx
Robusta -Tool Presentation (DevOps).pptx
 
Optimizing Kubernetes using GOLDILOCKS.pptx
Optimizing Kubernetes using GOLDILOCKS.pptxOptimizing Kubernetes using GOLDILOCKS.pptx
Optimizing Kubernetes using GOLDILOCKS.pptx
 
Azure Function App Exception Handling.pptx
Azure Function App Exception Handling.pptxAzure Function App Exception Handling.pptx
Azure Function App Exception Handling.pptx
 
CQRS Design Pattern Presentation (Java).pptx
CQRS Design Pattern Presentation (Java).pptxCQRS Design Pattern Presentation (Java).pptx
CQRS Design Pattern Presentation (Java).pptx
 
ETL Observability: Azure to Snowflake Presentation
ETL Observability: Azure to Snowflake PresentationETL Observability: Azure to Snowflake Presentation
ETL Observability: Azure to Snowflake Presentation
 
Scripting with K6 - Beyond the Basics Presentation
Scripting with K6 - Beyond the Basics PresentationScripting with K6 - Beyond the Basics Presentation
Scripting with K6 - Beyond the Basics Presentation
 
Getting started with dotnet core Web APIs
Getting started with dotnet core Web APIsGetting started with dotnet core Web APIs
Getting started with dotnet core Web APIs
 
Introduction To Rust part II Presentation
Introduction To Rust part II PresentationIntroduction To Rust part II Presentation
Introduction To Rust part II Presentation
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog Presentation
 
Configuring Workflows & Validators in JIRA
Configuring Workflows & Validators in JIRAConfiguring Workflows & Validators in JIRA
Configuring Workflows & Validators in JIRA
 
Advanced Python (with dependency injection and hydra configuration packages)
Advanced Python (with dependency injection and hydra configuration packages)Advanced Python (with dependency injection and hydra configuration packages)
Advanced Python (with dependency injection and hydra configuration packages)
 

Kürzlich hochgeladen

EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...aditisharan08
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)Intelisync
 

Kürzlich hochgeladen (20)

EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
Exploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the ProcessExploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the Process
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)
 

Drilling the Async Library

  • 1. Drilling the async Library By :- SAHIL SAWHNEY Software Consultant KNOLDUS SOFTWARE LLP By :- SAHIL SAWHNEY Software Consultant KNOLDUS SOFTWARE LLP
  • 2. Agenda Understanding ● Futures ● Case Study ● Macros ● Demonstration 1 ● The async library ● Demonstration 2
  • 3. Prologue async library is an asynchronous programming facility for Scala that offers a direct API for working with Futures. It was added in Scala version 2.10 and is implemented using macros. Its main constructs, async and await, are inspired by similar constructs introduced in C# 5.0. async library is an asynchronous programming facility for Scala that offers a direct API for working with Futures. It was added in Scala version 2.10 and is implemented using macros. Its main constructs, async and await, are inspired by similar constructs introduced in C# 5.0.
  • 4. CHAPTER - 1 Future ( The What, Why, When, … ) Future ( The What, Why, When, … )
  • 5. What is a Future? A Future is a place holder (an imaginary waiting box) which holds a value that may become available at some point. Example :- Consider a web service that fetch data from a specified URL and returns a String (time consuming operation) How to deal with such a scenario? A Future is a place holder (an imaginary waiting box) which holds a value that may become available at some point. Example :- Consider a web service that fetch data from a specified URL and returns a String (time consuming operation) How to deal with such a scenario?
  • 6.
  • 7. Why Future? ➔One of the most important trait of a programming language is to be patient for the code segments to complete their execution asynchronously with maximum possible parallelism. ➔And we use futures because they facilitates Scala with ‘the art of being patient and non blocking’. ➔One of the most important trait of a programming language is to be patient for the code segments to complete their execution asynchronously with maximum possible parallelism. ➔And we use futures because they facilitates Scala with ‘the art of being patient and non blocking’.
  • 8. Asynchronous and Parallelism Asynchronous means :- “Not occurring at the same time.” - Dictionary.com "Concurrency is about dealing with lots of things at once. Parallelism is about doing lots of things at once." - Rob Pike ➔In true parallelism you need at least two cores and the threads need to both be executing at the same time. Asynchronous means :- “Not occurring at the same time.” - Dictionary.com "Concurrency is about dealing with lots of things at once. Parallelism is about doing lots of things at once." - Rob Pike ➔In true parallelism you need at least two cores and the threads need to both be executing at the same time.
  • 9. When do we use Future? The operations which may take time (like I/O) to execute are enclosed under the Future scope which starts asynchronous computation and returns a Future value holding the result of the computation. We said that Future is an imaginary waiting box, so how to access the resultant value from this box? The operations which may take time (like I/O) to execute are enclosed under the Future scope which starts asynchronous computation and returns a Future value holding the result of the computation. We said that Future is an imaginary waiting box, so how to access the resultant value from this box?
  • 11. Access result of Future cont... The result (value or exception) from a Future can be accessed by following ways :- 1). Callbacks 2). Combinators 3). For Comprehensive 4). Await.result 5). The async library (async,await)
  • 13. Callbacks cont.. b). onSuccess -> c). onFailure ->
  • 14. Combinators Combinators like map, flatMap are used to transform a future value to a resultant future value. Combinators like map, flatMap are used to transform a future value to a resultant future value. Any problem in the above code ?
  • 15. Combinators cont.. Combinators like recover, recoverWith are used to handle the exception which may occur while accessing the value of a future. Combinators like recover, recoverWith are used to handle the exception which may occur while accessing the value of a future. Applying recover combinator
  • 16. For Comprehensive It is most commonly used in scenarios where we need multiple Future values to compute a result which is further a Future value. It is most commonly used in scenarios where we need multiple Future values to compute a result which is further a Future value.
  • 17. Await.result Internally Await use blocking and yields the result of associated Future by blocking the current thread, thus killing the asynchronous approach to code. Hence, It Await should only be used in test cases. Internally Await use blocking and yields the result of associated Future by blocking the current thread, thus killing the asynchronous approach to code. Hence, It Await should only be used in test cases.
  • 18. CHAPTER - 2 Macro ( What kind of sorcery is this? ) Macro ( What kind of sorcery is this? )
  • 19. What is macro? ➔In Scala macros are a way to implement compile time reflection. ➔These are ‘special functions’ as using macros we can access the compiler API’s (using the context) which provide us with the privilege to manage the AST(Abstract Syntax Tree) generated by the compiler. ➔AST is a data structure used by the Scala compiler to store the information about the compiled code ➔In Scala macros are a way to implement compile time reflection. ➔These are ‘special functions’ as using macros we can access the compiler API’s (using the context) which provide us with the privilege to manage the AST(Abstract Syntax Tree) generated by the compiler. ➔AST is a data structure used by the Scala compiler to store the information about the compiled code
  • 20. Why macro? Macros give programmer the power to :- ➔Inspecting type of an object, including generic type (Traversing, inspecting the AST) ➔Creating new objects.(Appending the AST with new child) ➔Access the member function of the object(Accessing the child nodes in AST) Macros give programmer the power to :- ➔Inspecting type of an object, including generic type (Traversing, inspecting the AST) ➔Creating new objects.(Appending the AST with new child) ➔Access the member function of the object(Accessing the child nodes in AST)
  • 21. When to use macro? Macro(The reflection cousin) is used when we have to performs the following operations: ➔Introspection: Program can examine itself. ➔Intercession: Program can modify its state/meaning. Macro(The reflection cousin) is used when we have to performs the following operations: ➔Introspection: Program can examine itself. ➔Intercession: Program can modify its state/meaning.
  • 22. Declaring a macro definition def add(num1:Int, num2:Int):Int = macro addImpl Here, ‘add’ is the name of the method ‘num1, num2’ is the parameter of type ’Int’ ‘Int’ is the return type of ‘add’ ‘macro’ is the keyword ‘addImpl’ is another method which provide the implementation for macro
  • 23. Implementing a macro Macro implementation is a method which defines the functionality of macro. It is a bit different from the normal methods in a way that the macro implementation work on AST and is called at the compile time (by compiler) with AST of the parameters rather than the parameter itself and also returns an AST of its return value. Macro implementation is a method which defines the functionality of macro. It is a bit different from the normal methods in a way that the macro implementation work on AST and is called at the compile time (by compiler) with AST of the parameters rather than the parameter itself and also returns an AST of its return value.
  • 24. Reify, Splice!!! Whats that? Macros implementation method returns an AST and this is achieved using the ‘reify’ and ‘splice’ method. a). reify() – The ‘reify’ method is in itself a macro which turns the code enclosed in its scope into its corresponding AST and type. b). splice() – The ‘splice’ method is a programmatic antonym of ‘reify’ as it turns the AST into a value with corresponding type. It can only be used inside the scope of ‘reify’. Macros implementation method returns an AST and this is achieved using the ‘reify’ and ‘splice’ method. a). reify() – The ‘reify’ method is in itself a macro which turns the code enclosed in its scope into its corresponding AST and type. b). splice() – The ‘splice’ method is a programmatic antonym of ‘reify’ as it turns the AST into a value with corresponding type. It can only be used inside the scope of ‘reify’.
  • 25. The compiler magic Let us now understand the sequence of events that occur when the compiler encounters a macro. Firstly, Call to macro implementation transforms in following way :- def add(num1:Int, num2:Int):Int = macro addImpl Bold part is converted to :- addImpl(c)(AST < 2 >, AST < 1 >) Here, 2 and 1 are the parameters to macro(operands to be added) and ‘AST<2>’ = ‘Literal(Constant(2))’ Let us now understand the sequence of events that occur when the compiler encounters a macro. Firstly, Call to macro implementation transforms in following way :- def add(num1:Int, num2:Int):Int = macro addImpl Bold part is converted to :- addImpl(c)(AST < 2 >, AST < 1 >) Here, 2 and 1 are the parameters to macro(operands to be added) and ‘AST<2>’ = ‘Literal(Constant(2))’
  • 26. The compiler magic cont.. Secondly, the return value of macro implementation which in itself is an AST(with a type) gets inlined to the AST of the main program and is type checked in turn. In other words, the macro declaration acts as the part of main AST to which the AST of the returned value of macro implementation is attached. Secondly, the return value of macro implementation which in itself is an AST(with a type) gets inlined to the AST of the main program and is type checked in turn. In other words, the macro declaration acts as the part of main AST to which the AST of the returned value of macro implementation is attached.
  • 27. A very important note Call to a macro can not be present in same ‘.scala file’ in which the macro and its implementation are present because the .scala file containing the code for macro implementation must be compiled first. Call to a macro can not be present in same ‘.scala file’ in which the macro and its implementation are present because the .scala file containing the code for macro implementation must be compiled first.
  • 28. CHAPTER - 3 Async library ( Finally :D ) Async library ( Finally :D )
  • 29. What is an async Library? ➔ async library can be considered as another alternative of low-level callbacks or high order functions like map and flat-map and is used to access the result of the future. ➔ Internally the async library is implemented using callbacks, our beloved macros and needs an ExecutionContext for code execution. ➔ It has Async object with only two methods namely ‘async()’ and ‘await()’
  • 30. The async method ➔Marks the beginning of the asynchronous code block ➔The execution of the code enclosed in async scope is execute on a thread from the thread pool. ➔ Inside the async scope we generally call the time consuming operations like call to a web service, fetching content of the file, fetching data from the databases like elastic search etc. ➔Marks the beginning of the asynchronous code block ➔The execution of the code enclosed in async scope is execute on a thread from the thread pool. ➔ Inside the async scope we generally call the time consuming operations like call to a web service, fetching content of the file, fetching data from the databases like elastic search etc.
  • 31. The await method ➔As the name suggests, this method waits for a future to complete its execution. ➔It can only be used inside a ‘async’ block but with some limitations ➔The call to ‘await’ method are translated into the call to ‘onComplete’ of the associated Future by the async macro ➔As the name suggests, this method waits for a future to complete its execution. ➔It can only be used inside a ‘async’ block but with some limitations ➔The call to ‘await’ method are translated into the call to ‘onComplete’ of the associated Future by the async macro
  • 32. Why use async library? ➔Increase the readability and simplicity of code. ➔Reduces code complexity for the programmer. ➔Increase the readability and simplicity of code. ➔Reduces code complexity for the programmer.
  • 33. When to use async library? When we want to access the value of a future in a non blocking way. Since the documentation of the async library is marked with improvement process, it has quite some limitations. When we want to access the value of a future in a non blocking way. Since the documentation of the async library is marked with improvement process, it has quite some limitations.
  • 34. Limitations of async library? ➔‘await’ requires a directly enclosing ‘async’ block ➔‘await’ can not be used inside a nested object, trait, or class inside ‘async’ ➔ ‘await’ must not be used inside a Boolean short- circuit argument ➔Return expressions are illegal inside an ‘async’ block. ➔‘await’ requires a directly enclosing ‘async’ block ➔‘await’ can not be used inside a nested object, trait, or class inside ‘async’ ➔ ‘await’ must not be used inside a Boolean short- circuit argument ➔Return expressions are illegal inside an ‘async’ block.
  • 35. The code transformations The code inside the async scope undergoes two levels of transformation In first phase, code is normalized to a form that can further be transformed into a state machine. In second phase, normalized code is transformed into state machine The code inside the async scope undergoes two levels of transformation In first phase, code is normalized to a form that can further be transformed into a state machine. In second phase, normalized code is transformed into state machine
  • 36. ‘A-Normal Form'(ANF) transformation Following changes happen at phase one ➔All control flow constructs like ‘if’ and ‘match’ are transformed from expression to statements and there results are stored in compiler fabricated variable. ➔All the calls to the ‘await’ methods are removed from the code and instead compiler fabricated variables are used to store their result. Following changes happen at phase one ➔All control flow constructs like ‘if’ and ‘match’ are transformed from expression to statements and there results are stored in compiler fabricated variable. ➔All the calls to the ‘await’ methods are removed from the code and instead compiler fabricated variables are used to store their result.
  • 37. Full Async Transformation (State machine code) The code associated with the full async transformation is compiler synthesised and is not discussed in details here(litle bit of abstarction is always welcomed :p) Finally, Corresponding bytecode for the state machine code is generated at the end of the compilation process. The code associated with the full async transformation is compiler synthesised and is not discussed in details here(litle bit of abstarction is always welcomed :p) Finally, Corresponding bytecode for the state machine code is generated at the end of the compilation process.
  • 38. A very important note Call to a macro can not be present in same ‘.scala file’ in which the macro and its implementation are present because the .scala file containing the code for macro implementation must be compiled first. Call to a macro can not be present in same ‘.scala file’ in which the macro and its implementation are present because the .scala file containing the code for macro implementation must be compiled first.
  • 39. Summing up At COMPILE time -> The code marked under the async scope is transformed into its corresponding compiler synthesized state machine code by the ‘asyncImpl’ macro implementation method of the ‘async’ macro from which the byte-code is generated at the end of the compilation process. At COMPILE time -> The code marked under the async scope is transformed into its corresponding compiler synthesized state machine code by the ‘asyncImpl’ macro implementation method of the ‘async’ macro from which the byte-code is generated at the end of the compilation process.
  • 40. Summing up cont.. At Run time -> As the byte-code corresponding to the async block is approached for its execution, a thread from the thread-pool(remember the EcecutionContext) is assigned to it and the execution takes place asynchronously. At Run time -> As the byte-code corresponding to the async block is approached for its execution, a thread from the thread-pool(remember the EcecutionContext) is assigned to it and the execution takes place asynchronously.
  • 41. Important note The async scope in itself is asynchronous but the execution inside this scope is synchronous. The async scope in itself is asynchronous but the execution inside this scope is synchronous.