SlideShare une entreprise Scribd logo
1  sur  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 !!!

Contenu connexe

Tendances

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
 

Tendances (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
 

En vedette

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.
 

En vedette (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
 

Similaire à 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
 

Similaire à 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
 

Plus de Knoldus 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.
 
Azure Databricks (For Data Analytics).pptx
Azure Databricks (For Data Analytics).pptxAzure Databricks (For Data Analytics).pptx
Azure Databricks (For Data Analytics).pptxKnoldus Inc.
 
The Power of Dependency Injection with Dagger 2 and Kotlin
The Power of Dependency Injection with Dagger 2 and KotlinThe Power of Dependency Injection with Dagger 2 and Kotlin
The Power of Dependency Injection with Dagger 2 and KotlinKnoldus Inc.
 
Data Engineering with Databricks Presentation
Data Engineering with Databricks PresentationData Engineering with Databricks Presentation
Data Engineering with Databricks PresentationKnoldus Inc.
 
Databricks for MLOps Presentation (AI/ML)
Databricks for MLOps Presentation (AI/ML)Databricks for MLOps Presentation (AI/ML)
Databricks for MLOps Presentation (AI/ML)Knoldus Inc.
 
NoOps - (Automate Ops) Presentation.pptx
NoOps - (Automate Ops) Presentation.pptxNoOps - (Automate Ops) Presentation.pptx
NoOps - (Automate Ops) Presentation.pptxKnoldus Inc.
 
Mastering Distributed Performance Testing
Mastering Distributed Performance TestingMastering Distributed Performance Testing
Mastering Distributed Performance TestingKnoldus Inc.
 
MLops on Vertex AI Presentation (AI/ML).pptx
MLops on Vertex AI Presentation (AI/ML).pptxMLops on Vertex AI Presentation (AI/ML).pptx
MLops on Vertex AI Presentation (AI/ML).pptxKnoldus Inc.
 
Introduction to Ansible Tower Presentation
Introduction to Ansible Tower PresentationIntroduction to Ansible Tower Presentation
Introduction to Ansible Tower PresentationKnoldus Inc.
 
CQRS with dot net services presentation.
CQRS with dot net services presentation.CQRS with dot net services presentation.
CQRS with dot net services presentation.Knoldus Inc.
 

Plus de Knoldus Inc. (20)

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)
 
Azure Databricks (For Data Analytics).pptx
Azure Databricks (For Data Analytics).pptxAzure Databricks (For Data Analytics).pptx
Azure Databricks (For Data Analytics).pptx
 
The Power of Dependency Injection with Dagger 2 and Kotlin
The Power of Dependency Injection with Dagger 2 and KotlinThe Power of Dependency Injection with Dagger 2 and Kotlin
The Power of Dependency Injection with Dagger 2 and Kotlin
 
Data Engineering with Databricks Presentation
Data Engineering with Databricks PresentationData Engineering with Databricks Presentation
Data Engineering with Databricks Presentation
 
Databricks for MLOps Presentation (AI/ML)
Databricks for MLOps Presentation (AI/ML)Databricks for MLOps Presentation (AI/ML)
Databricks for MLOps Presentation (AI/ML)
 
NoOps - (Automate Ops) Presentation.pptx
NoOps - (Automate Ops) Presentation.pptxNoOps - (Automate Ops) Presentation.pptx
NoOps - (Automate Ops) Presentation.pptx
 
Mastering Distributed Performance Testing
Mastering Distributed Performance TestingMastering Distributed Performance Testing
Mastering Distributed Performance Testing
 
MLops on Vertex AI Presentation (AI/ML).pptx
MLops on Vertex AI Presentation (AI/ML).pptxMLops on Vertex AI Presentation (AI/ML).pptx
MLops on Vertex AI Presentation (AI/ML).pptx
 
Introduction to Ansible Tower Presentation
Introduction to Ansible Tower PresentationIntroduction to Ansible Tower Presentation
Introduction to Ansible Tower Presentation
 
CQRS with dot net services presentation.
CQRS with dot net services presentation.CQRS with dot net services presentation.
CQRS with dot net services presentation.
 

Dernier

PREDICTING RIVER WATER QUALITY ppt presentation
PREDICTING  RIVER  WATER QUALITY  ppt presentationPREDICTING  RIVER  WATER QUALITY  ppt presentation
PREDICTING RIVER WATER QUALITY ppt presentationvaddepallysandeep122
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Cizo Technology Services
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Andreas Granig
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024StefanoLambiase
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfFerryKemperman
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...OnePlan Solutions
 
Xen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfXen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfStefano Stabellini
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)jennyeacort
 
Cyber security and its impact on E commerce
Cyber security and its impact on E commerceCyber security and its impact on E commerce
Cyber security and its impact on E commercemanigoyal112
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...Technogeeks
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样umasea
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Velvetech LLC
 
How to Track Employee Performance A Comprehensive Guide.pdf
How to Track Employee Performance A Comprehensive Guide.pdfHow to Track Employee Performance A Comprehensive Guide.pdf
How to Track Employee Performance A Comprehensive Guide.pdfLivetecs LLC
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsAhmed Mohamed
 
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
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based projectAnoyGreter
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceBrainSell Technologies
 

Dernier (20)

PREDICTING RIVER WATER QUALITY ppt presentation
PREDICTING  RIVER  WATER QUALITY  ppt presentationPREDICTING  RIVER  WATER QUALITY  ppt presentation
PREDICTING RIVER WATER QUALITY ppt presentation
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdf
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
 
Xen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfXen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdf
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
 
Cyber security and its impact on E commerce
Cyber security and its impact on E commerceCyber security and its impact on E commerce
Cyber security and its impact on E commerce
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...
 
How to Track Employee Performance A Comprehensive Guide.pdf
How to Track Employee Performance A Comprehensive Guide.pdfHow to Track Employee Performance A Comprehensive Guide.pdf
How to Track Employee Performance A Comprehensive Guide.pdf
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
 
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
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based project
 
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort ServiceHot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. Salesforce
 

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.