Clojure Reactive Programming
eBook - ePub

Clojure Reactive Programming

Leonardo Borges

Condividi libro
  1. 232 pagine
  2. English
  3. ePUB (disponibile sull'app)
  4. Disponibile su iOS e Android
eBook - ePub

Clojure Reactive Programming

Leonardo Borges

Dettagli del libro
Anteprima del libro
Indice dei contenuti
Citazioni

Domande frequenti

Come faccio ad annullare l'abbonamento?
È semplicissimo: basta accedere alla sezione Account nelle Impostazioni e cliccare su "Annulla abbonamento". Dopo la cancellazione, l'abbonamento rimarrà attivo per il periodo rimanente già pagato. Per maggiori informazioni, clicca qui
È possibile scaricare libri? Se sì, come?
Al momento è possibile scaricare tramite l'app tutti i nostri libri ePub mobile-friendly. Anche la maggior parte dei nostri PDF è scaricabile e stiamo lavorando per rendere disponibile quanto prima il download di tutti gli altri file. Per maggiori informazioni, clicca qui
Che differenza c'è tra i piani?
Entrambi i piani ti danno accesso illimitato alla libreria e a tutte le funzionalità di Perlego. Le uniche differenze sono il prezzo e il periodo di abbonamento: con il piano annuale risparmierai circa il 30% rispetto a 12 rate con quello mensile.
Cos'è Perlego?
Perlego è un servizio di abbonamento a testi accademici, che ti permette di accedere a un'intera libreria online a un prezzo inferiore rispetto a quello che pagheresti per acquistare un singolo libro al mese. Con oltre 1 milione di testi suddivisi in più di 1.000 categorie, troverai sicuramente ciò che fa per te! Per maggiori informazioni, clicca qui.
Perlego supporta la sintesi vocale?
Cerca l'icona Sintesi vocale nel prossimo libro che leggerai per verificare se è possibile riprodurre l'audio. Questo strumento permette di leggere il testo a voce alta, evidenziandolo man mano che la lettura procede. Puoi aumentare o diminuire la velocità della sintesi vocale, oppure sospendere la riproduzione. Per maggiori informazioni, clicca qui.
Clojure Reactive Programming è disponibile online in formato PDF/ePub?
Sì, puoi accedere a Clojure Reactive Programming di Leonardo Borges in formato PDF e/o ePub, così come ad altri libri molto apprezzati nelle sezioni relative a Ciencia de la computación e Lenguajes de programación. Scopri oltre 1 milione di libri disponibili nel nostro catalogo.

Informazioni

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...

Indice dei contenuti