Clojure Reactive Programming
eBook - ePub

Clojure Reactive Programming

Leonardo Borges

Partager le livre
  1. 232 pages
  2. English
  3. ePUB (adapté aux mobiles)
  4. Disponible sur iOS et Android
eBook - ePub

Clojure Reactive Programming

Leonardo Borges

DĂ©tails du livre
Aperçu du livre
Table des matiĂšres
Citations

Foire aux questions

Comment puis-je résilier mon abonnement ?
Il vous suffit de vous rendre dans la section compte dans paramĂštres et de cliquer sur « RĂ©silier l’abonnement ». C’est aussi simple que cela ! Une fois que vous aurez rĂ©siliĂ© votre abonnement, il restera actif pour le reste de la pĂ©riode pour laquelle vous avez payĂ©. DĂ©couvrez-en plus ici.
Puis-je / comment puis-je télécharger des livres ?
Pour le moment, tous nos livres en format ePub adaptĂ©s aux mobiles peuvent ĂȘtre tĂ©lĂ©chargĂ©s via l’application. La plupart de nos PDF sont Ă©galement disponibles en tĂ©lĂ©chargement et les autres seront tĂ©lĂ©chargeables trĂšs prochainement. DĂ©couvrez-en plus ici.
Quelle est la différence entre les formules tarifaires ?
Les deux abonnements vous donnent un accĂšs complet Ă  la bibliothĂšque et Ă  toutes les fonctionnalitĂ©s de Perlego. Les seules diffĂ©rences sont les tarifs ainsi que la pĂ©riode d’abonnement : avec l’abonnement annuel, vous Ă©conomiserez environ 30 % par rapport Ă  12 mois d’abonnement mensuel.
Qu’est-ce que Perlego ?
Nous sommes un service d’abonnement Ă  des ouvrages universitaires en ligne, oĂč vous pouvez accĂ©der Ă  toute une bibliothĂšque pour un prix infĂ©rieur Ă  celui d’un seul livre par mois. Avec plus d’un million de livres sur plus de 1 000 sujets, nous avons ce qu’il vous faut ! DĂ©couvrez-en plus ici.
Prenez-vous en charge la synthÚse vocale ?
Recherchez le symbole Écouter sur votre prochain livre pour voir si vous pouvez l’écouter. L’outil Écouter lit le texte Ă  haute voix pour vous, en surlignant le passage qui est en cours de lecture. Vous pouvez le mettre sur pause, l’accĂ©lĂ©rer ou le ralentir. DĂ©couvrez-en plus ici.
Est-ce que Clojure Reactive Programming est un PDF/ePUB en ligne ?
Oui, vous pouvez accĂ©der Ă  Clojure Reactive Programming par Leonardo Borges en format PDF et/ou ePUB ainsi qu’à d’autres livres populaires dans Ciencia de la computaciĂłn et Lenguajes de programaciĂłn. Nous disposons de plus d’un million d’ouvrages Ă  dĂ©couvrir dans notre catalogue.

Informations

Clojure Reactive Programming


Table of Contents

Clojure Reactive Programming
Credits
About the Author
Acknowledgments
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. What is Reactive Programming?
A taste of Reactive Programming
Creating time
More colors
Making it reactive
Exercise 1.1
A bit of history
Dataflow programming
Object-oriented Reactive Programming
The most widely used reactive program
The Observer design pattern
Functional Reactive Programming
Higher-order FRP
Signals and events
Implementation challenges
First-order FRP
Asynchronous data flow
Arrowized FRP
Applications of FRP
Asynchronous programming and networking
Complex GUIs and animations
Summary
2. A Look at Reactive Extensions
The Observer pattern revisited
Observer – an Iterator's dual
Creating Observables
Custom Observables
Manipulating Observables
Flatmap and friends
One more flatmap for the road
Error handling
OnError
Catch
Retry
Backpressure
Sample
Backpressure strategies
Summary
3. Asynchronous Programming and Networking
Building a stock market monitoring application
Rolling averages
Identifying problems with our current approach
Removing incidental complexity with RxClojure
Observable rolling averages
Summary
4. Introduction to core.async
Asynchronous programming and concurrency
core.async
Communicating sequential processes
Rewriting the stock market application with core.async
Implementing the application code
Error handling
Backpressure
Fixed buffer
Dropping buffer
Sliding buffer
Transducers
Transducers and core.async
Summary
5. Creating Your Own CES Framework with core.async
A minimal CES framework
Clojure or ClojureScript?
Designing the public API
Implementing tokens
Implementing event streams
Implementing behaviors
Exercises
Exercise 5.1
Exercise 5.2
A respondent application
CES versus core.async
Summary
6. Building a Simple ClojureScript Game with Reagi
Setting up the project
Game entities
Putting it all together
Modeling user input as event streams
Working with the active keys stream
Reagi and other CES frameworks
Summary
7. The UI as a Function
The problem with complex web UIs
Enter React.js
Lessons from functional programming
ClojureScript and Om
Building a simple Contacts application with Om
The Contacts application state
Setting up the Contacts project
Application components
Om cursors
Filling in the blanks
Intercomponent communication
Creating an agile board with Om
The board state
Components overview
Lifecycle and component local state
Remaining components
Utility functions
Exercises
Summary
8. Futures
Clojure futures
Fetching data in parallel
Imminent – a composable futures library for Clojure
Creating futures
Combinators and event handlers
The movies example revisited
Futures and blocking IO
Summary
9. A Reactive API to Amazon Web Services
The problem
Infrastructure automation
AWS resources dashboard
CloudFormation
The describeStacks endpoint
The describeStackResources endpoint
EC2
The describeInstances endpoint
RDS
The describeDBInstances endpoint
Designing the solution
Running the AWS stub server
Setting up the dashboard project
Creating AWS Observables
Combining the AWS Observables
Putting it all together
Exercises
Summary
A. The Algebra of Library Design
The semantics of map
Functors
The Option Functor
Finding the average of ages
Applicative Functors
Gathering stats about ages
Monads
Summary
B. Bibliography
Index

Clojure Reactive Programming

Copyright © 2015 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
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.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: March 2015
Production reference: 1160315
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-78398-666-8
www.packtpub.com

Credits

Author
Leonardo Borges
Reviewers
Eduard Bondarenko
Colin Jones
Michael Kohl
Falko Riemenschneider
Acquisition Editor
Harsha Bharwani
Content Development Editor
Arun Nadar
Technical Editor
Tanvi Bhatt
Copy Editors
Vikrant Phadke
Sameen Siddiqui
Project Coordinator
Neha Bhatnagar
Proofreaders
Simran Bhogal
Maria Gould
Indexer
Mariammal Chettiyar
Graphics
Abhinash Sahu
Production Coordinator
Manu Joseph
Cover Work
Manu Joseph

About the Author

Leonardo Borges is a programming languages enthusiast who loves writing code, contributing to open source software, and speaking on subjects he feels strongly about. After nearly 5 years of consulting at ThoughtWorks, where he worked in two commercial Clojure projects, among many others, he is now a software engineer at Atlassian. He uses Clojure and ClojureScript to help build real-time collaborative editing technology. This is his first full-length book, but he contributed a couple of chapters to Clojure Cookbook, O'Reilly.
Leonardo has founded and runs the Sydney Clojure User Group in Australia. He also writes posts about software, focusing on functional programming, on his website (http://www.leonardoborges.com). When he isn't writing code, he enjoys riding motorcycles, weightlifting, and playing the guitar.

Acknowledgments

I would like to take this opportunity and start by thanking my family: my grandparents, Altamir and Alba, for their tireless support; my mother, SĂŽnia, for her unconditional love and motivation; and my uncle, Altamir Filho, for supporting me when I decided to go to school at night so that I could start working as a programmer. Without them, I would have never pursued software engineering.
I would also like to thank my fiancee, Enif, who answered with a resounding "yes" when asked whether I should take up the challenge of writing a...

Table des matiĂšres