Learning Reactive Programming with Java 8 1st Edition Nickolay Tsvetinov pdf download
Learning Reactive Programming with Java 8 1st Edition Nickolay Tsvetinov pdf download
https://ebookname.com/product/learning-reactive-programming-with-
java-8-1st-edition-nickolay-tsvetinov/
https://ebookname.com/product/pro-java-8-programming-3rd-edition-
terrill-brett-spell/
https://ebookname.com/product/functional-reactive-
programming-1st-edition-stephen-blackheath/
https://ebookname.com/product/practical-database-programming-
with-java-1st-edition-ying-bai/
https://ebookname.com/product/charge-and-energy-transfer-
dynamics-in-molecular-systems-third-edition-dr-volkhard-may/
Grim Reaper End of Days 1st Edition Steve Alten
https://ebookname.com/product/grim-reaper-end-of-days-1st-
edition-steve-alten/
https://ebookname.com/product/dk-eyewitness-top-10-travel-guide-
las-vegas-1st-edition-connie-emerson/
https://ebookname.com/product/inderbir-singh-s-textbook-of-human-
histology-with-colour-atlas-and-practical-guide-7th-revised-
edition-neelam-vasudeva/
https://ebookname.com/product/shadow-banking-scope-origins-and-
theories-1st-edition-nesvetailova/
https://ebookname.com/product/construction-project-scheduling-
and-control-3rd-edition-saleh-a-mubarak/
Education in Political Science Discovering a Neglected
Field 1st Edition Anja P. Jakobi
https://ebookname.com/product/education-in-political-science-
discovering-a-neglected-field-1st-edition-anja-p-jakobi/
Table of Contents
Learning Reactive Programming with Java 8
Credits
About the Author
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers, and more
Why subscribe?
Free access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. An Introduction to Reactive Programming
What is reactive programming?
Why should we be reactive?
Introducing RxJava
Downloading and setting up RxJava
Comparing the iterator pattern and the RxJava Observable
Implementing the reactive sum
Summary
2. Using the Functional Constructions of Java 8
Lambdas in Java 8
Introducing the new syntax and semantics
Functional interfaces in Java 8 and RxJava
Implementing the reactive sum example with lambdas
Pure functions and higher order functions
Pure functions
Higher order functions
RxJava and functional programming
Summary
3. Creating and Connecting Observables, Observers, and Subjects
The Observable.from method
The Observable.just method
Other Observable factory methods
The Observable.create method
Subscribing and unsubscribing
Hot and cold Observable instances
The ConnectableObservable class
The Subject instances
Summary
4. Transforming, Filtering, and Accumulating Your Data
Observable transformations
Transformations with the various flatMap operators
Grouping items
Additional useful transformation operators
Filtering data
Accumulating data
Summary
5. Combinators, Conditionals, and Error Handling
Combining the Observable instances
The zip operator
The combineLatest operator
The merge operator
The concat operator
The conditional operators
The amb operator
The takeUntil(), takeWhile(), skipUntil(), and skipWhile()
conditional operators
The defaultIfEmpty( ) operator
Handling errors
The return and resume operators
The retrying technique
An HTTP client example
Summary
6. Using Concurrency and Parallelism with Schedulers
RxJava's schedulers
Debugging Observables and their schedulers
The interval Observable and its default scheduler
Types of schedulers
The Schedulers.immediate scheduler
The Schedulers.trampoline scheduler
The Schedulers.newThread scheduler
The Schedulers.computation scheduler
The Schedulers.io scheduler
The Schedulers.from(Executor) method
Combining Observables and schedulers
The Observable<T> subscribeOn(Scheduler) method
The Observable<T> observeOn(Scheduler) operator
Parallelism
Buffering, throttling, and debouncing
Throttling
Debouncing
The buffer and window operators
The backpressure operators
Summary
7. Testing Your RxJava Application
Testing using simple subscription
The BlockingObservable class
The aggregate operators and the BlockingObservable class
Testing with the aggregate operators and the BlockingObservable
class
Using the TestSubscriber class for in-depth testing
Testing asynchronous Observable instances with the help of the
TestScheduler class
Summary
8. Resource Management and Extending RxJava
Resource management
Introducing the Observable.using method
Caching data with Observable.cache
Creating custom operators with lift
Composing multiple operators with the Observable.compose
operator
Summary
Index
Learning Reactive
Programming with Java 8
Learning Reactive
Programming with Java 8
Copyright © 2015 Packt Publishing
Every effort has been made in the preparation of this book to ensure
the accuracy of the information presented. However, the information
contained in this book is sold without warranty, either express or
implied. Neither the author, nor Packt Publishing, and its dealers and
distributors will be held liable for any damages caused or alleged to
be caused directly or indirectly by this book.
Livery Place
35 Livery Street
ISBN 978-1-78528-872-2
www.packtpub.com
Credits
Author
Nickolay Tsvetinov
Reviewers
Samuel Gruetter
Dávid Karnok
Timo Tuominen
Shixiong Zhu
Commissioning Editor
Veena Pagare
Acquisition Editor
Larrisa Pinto
Adrian Raposo
Technical Editor
Abhishek R. Kotian
Copy Editors
Brandt D'mello
Neha Vyas
Project Coordinator
Sanchita Mandal
Proofreader
Safis Editing
Indexer
Mariammal Chettiyar
Production Coordinator
Conidon Miranda
Cover Work
Conidon Miranda
About the Author
Nickolay Tsvetinov is a professional all-round web developer at
TransportAPI—Britain's first comprehensive open platform for
transport solutions. During his career as a software developer, he
experienced both good and bad and played with most of the popular
programming languages—from C and Java to Ruby and JavaScript.
For the last 3-4 years, he's been creating and maintaining single-
page applications (SPA) and the backend API architectures that
serve them. He is a fan of open source software, Rails, Vim, Sinatra,
Ember.js, Node.js, and Nintendo. He was an unsuccessful musician
and poet, but he is a successful husband and father. His area of
interest and expertise includes the declarative/functional and
reactive programming that resulted in the creation of ProAct.js
(http://proactjs.com), which is a library that augments the JavaScript
language and turns it into a reactive language.
He has been working with Java and related core technologies since
2005 to bring Java's benefits to manufacturing and logistic
companies.
Did you know that Packt offers eBook versions of every book
published, with PDF and ePub files available? You can upgrade to
the eBook version at www.PacktPub.com and as a print book
customer, you are entitled to a discount on the eBook copy. Get in
touch with us at <service@packtpub.com> for more details.
https://www2.packtpub.com/books/subscription/packtlib
Why subscribe?
Fully searchable across every book published by Packt
Copy and paste, print, and bookmark content
On demand and accessible via a web browser
Free access for Packt account holders
If you have an account with Packt at www.PacktPub.com, you can
use this to access PacktLib today and view 9 entirely free books.
Simply use your login credentials for immediate access.
Preface
Reactive programming has been around for decades. There has
been a few implementations of reactive programming from the time
Smalltalk was a young language. However, it has only become
popular recently and it is now becoming a trend. Why now you ask?
Because it is good for writing fast, real-time applications and current
technologies and the Web demand this.
I got involved in it back in 2008, when the team I was part of was
developing a multimedia book creator called Sophie 2. It had to be
fast and responsive so we created a framework called Prolib, which
provided objects with properties which could depend on each other
(in other words, we implemented bindings for Swing and much more
—transformations, filtering, and so on). It felt natural to wire the
model data to the GUI like this.
Of course, this was far away from the functional-like approach that
comes with RX. In 2010, Microsoft released RX and, after that,
Netflix ported it to Java—RxJava. However, Netflix released RxJava
to the open source community and the project became a huge
success. Many other languages have their port of RX and many
alternatives to it. Now, you can code using reactive programming on
your Java backend and wire it to your RxJava's frontend.
Observable
.just('R', 'x', 'J', 'a', 'v', 'a')
.subscribe(
System.out::print,
System.err::println,
System.out::println
);
New terms and important words are shown in bold. Words that you
see on the screen, for example, in menus or dialog boxes, appear in
the text like this: "Interfaces of this type are called functional
interfaces."
Note
Warnings or important notes appear in a box like this.
Tip
Tips and tricks appear like this.
Reader feedback
Feedback from our readers is always welcome. Let us know what
you think about this book—what you liked or disliked. Reader
feedback is important for us as it helps us develop titles that you will
really get the most out of.
If there is a topic that you have expertise in and you are interested in
either writing or contributing to a book, see our author guide at
www.packtpub.com/authors.
Customer support
Now that you are the proud owner of a Packt book, we have a
number of things to help you to get the most from your purchase.
Errata
Although we have taken every care to ensure the accuracy of our
content, mistakes do happen. If you find a mistake in one of our
books—maybe a mistake in the text or the code—we would be
grateful if you could report this to us. By doing so, you can save
other readers from frustration and help us improve subsequent
versions of this book. If you find any errata, please report them by
visiting http://www.packtpub.com/submit-errata, selecting your book,
clicking on the Errata Submission Form link, and entering the
details of your errata. Once your errata are verified, your submission
will be accepted and the errata will be uploaded to our website or
added to any list of existing errata under the Errata section of that
title.
Piracy
Exploring the Variety of Random
Documents with Different Content
The Project Gutenberg eBook of True Tales of
Mountain Adventures: For Non-Climbers
Language: English
Frontispiece.
TRUE TALES OF
MOUNTAIN ADVENTURE
FOR NON-CLIMBERS YOUNG AND OLD
BY
NEW YORK
E. P. DUTTON & COMPANY
1903
TO
MR EDWARD WHYMPER
WHOSE SPIRITED WRITINGS AND GRAPHIC PENCIL FIRST
AWAKENED
AN INTEREST IN MOUNTAINEERING AMONGST THOSE WHO
HAD NEVER CLIMBED, I DEDICATE THESE TRUE TALES
FROM THE HILLS, THE MATERIAL FOR SOME OF
THE MOST STRIKING OF WHICH I OWE
TO HIS GENEROSITY.
PREFACE
E. LE BLOND.
67, The Drive,
Brighton, Oct. 30th, 1902.
CONTENTS.
CHAP. PAGE
PREFACE vii.
I. WHAT IS MOUNTAINEERING? 1
II. A FEW WORDS ABOUT GLACIERS 7
III. AVALANCHES 15
IV. THE GUIDES OF THE ALPS 22
V. THE GUIDES OF THE ALPS (Continued) 50
VI. AN AVALANCHE ON THE HAUT-DE-CRY—A RACE 59
FOR LIFE
VII. CAUGHT IN AN AVALANCHE ON THE 72
MATTERHORN—THE ICE-AVALANCHE OF THE
ALTELS—AN AVALANCHE WHICH ROBBED A LADY
OF A GARMENT
VIII. LOST IN THE ICE FOR FORTY YEARS 92
IX. THE MOST TERRIBLE OF ALL ALPINE TRAGEDIES 107
X. A WONDERFUL SLIDE DOWN A WALL OF ICE 113
XI. AN ADVENTURE ON THE TRIFT PASS—THE 122
PERILS OF THE MOMING PASS
XII. AN EXCITING PASSAGE OF THE COL DE PILATTE 134
XIII. AN ADVENTURE ON THE ALETSCH GLACIER—A 142
LOYAL COMPANION—A BRAVE GUIDE
XIV. A WONDERFUL FEAT BY TWO LADIES—A 153
PERILOUS CLIMB
XV. A FINE PERFORMANCE WITHOUT GUIDES 170
XVI. THE PIZ SCERSCEN TWICE IN FOUR DAYS—THE 194
FIRST ASCENT BY A WOMAN OF MONT BLANC
XVII. THE ASCENT OF A WALL OF ICE 208
XVIII. THE AIGUILLE DU DRU 221
XIX. THE MOST FAMOUS MOUNTAIN IN THE ALPS— 250
THE CONQUEST OF THE MATTERHORN
XX. SOME TRAGEDIES ON THE MATTERHORN 268
XXI. THE WHOLE DUTY OF THE CLIMBER—ALPINE 289
DISTRESS SIGNALS
GLOSSARY 293
INDEX 295
LIST OF ILLUSTRATIONS
PAGE
Melchior Anderegg, 1894 Frontispiece
Climbers Descending the Ortler 2
The Aletsch Glacier from Bel Alp 7
General View of a Glacier 8
A Glacier Table: after a Storm 11
A Crevassed Glacier 13
An Avalanche near Bouveret: a Tunnel through an 17
Avalanche
Edouard Cupelin 22
Descending a Rock Peak near Zermatt 31
A Big Crevasse: the Gentle Persuasion of the Rope 37
A Typical Couloir: the Ober Gabelhorn: the Wrong 42
Way to Descend: Very Soft Snow
Piz Palü: Hans and Christian Grass 44
Christian Almer, 1894 54
An Avalanche Falling 59
Eiger and Mönch from Lauberhorn 66
Avalanche Falling from the Wetterhorn 79
On Monte Rosa 83
Mr Whymper: Mrs Aubrey Le Blond: Group on a 85
High Peak in Winter
Mrs Aubrey Le Blond and Joseph Imboden: 89
Crossing a Snow Couloir
Mont Blanc: Nicolas Winhart: a Banker of Geneva: 92
the Relics of the Arkwright Accident
Alpine Snow-Fields 108
A Start by Moonlight: Shadows at Sunrise: a 136
Standing Glissade: a Sitting Glissade
On a Snow-Covered Glacier 148
Martin Schocher and Schnitzler 150
Exterior of a Climber's Hut: Interior 157
The Meije: Ascending a Snowy Wall 171
Top of Piz Scerscen: Party Descending Piz Bernina: 194
On a Mountain Top: Descent of a Snow-Ridge
Hard Work: Setting Out in a Long Skirt 204
A Steep Icy Slope: On the Top of a Pass 216
A Slab of Rock: Negotiating a Steep Passage 225
The Family of Herr Seiler, Zermatt: Going to 250
Zermatt in the Olden Days
The Guides' Wall, Zermatt 259
The Zermatt Side of the Matterhorn: Rising Mists 260
A Bitterly Cold Day: The Matterhorn from the Zmutt 265
Side
Jost, Porter of Hotel Monte Rosa, Zermatt 268
Hoar Frost in the Alps 274
ERRATA
It is from going with and watching how good guides climb that most
people learn to become mountaineers themselves. Nearly all take
guides whenever they ascend difficult mountains, but some are so
skilful and experienced that they go without, though few are ever
good enough to do this quite safely.
I am often asked why people climb, and it is a hard question to
answer satisfactorily. There is something which makes one long to
mountaineer more and more, from the first time one tries it. All
climbs are different. All views from mountains are different, and
every time one climbs one is uncertain, owing to the weather or the
possible state of the peak, if the top can be reached or not. So it is
always a struggle between the mountain and the climber, and
though perseverance, skill, experience, and pluck must give the
victory to the climber in the end, yet the fight may be a long one,
and it may be years before a particularly awkward peak allows one
to stand on its summit.
Perhaps, if you have patience to read what follows, you may better
understand what mountaineering is, and why most of those who
have once tried it become so fond of it.
Many of the most terrible accidents in the Alps have been due to
avalanches, and perhaps, as avalanches take place from different
causes and have various characteristics, according to whether they
are of ice, snow, or débris, some account of them may not be out of
place.
We may briefly classify them as follows:—
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
ebookname.com