Clojure Reactive Programming
eBook - ePub

Clojure Reactive Programming

Leonardo Borges

Compartir libro
  1. 232 páginas
  2. English
  3. ePUB (apto para móviles)
  4. Disponible en iOS y Android
eBook - ePub

Clojure Reactive Programming

Leonardo Borges

Detalles del libro
Vista previa del libro
Índice
Citas

Preguntas frecuentes

¿Cómo cancelo mi suscripción?
Simplemente, dirígete a la sección ajustes de la cuenta y haz clic en «Cancelar suscripción». Así de sencillo. Después de cancelar tu suscripción, esta permanecerá activa el tiempo restante que hayas pagado. Obtén más información aquí.
¿Cómo descargo los libros?
Por el momento, todos nuestros libros ePub adaptables a dispositivos móviles se pueden descargar a través de la aplicación. La mayor parte de nuestros PDF también se puede descargar y ya estamos trabajando para que el resto también sea descargable. Obtén más información aquí.
¿En qué se diferencian los planes de precios?
Ambos planes te permiten acceder por completo a la biblioteca y a todas las funciones de Perlego. Las únicas diferencias son el precio y el período de suscripción: con el plan anual ahorrarás en torno a un 30 % en comparación con 12 meses de un plan mensual.
¿Qué es Perlego?
Somos un servicio de suscripción de libros de texto en línea que te permite acceder a toda una biblioteca en línea por menos de lo que cuesta un libro al mes. Con más de un millón de libros sobre más de 1000 categorías, ¡tenemos todo lo que necesitas! Obtén más información aquí.
¿Perlego ofrece la función de texto a voz?
Busca el símbolo de lectura en voz alta en tu próximo libro para ver si puedes escucharlo. La herramienta de lectura en voz alta lee el texto en voz alta por ti, resaltando el texto a medida que se lee. Puedes pausarla, acelerarla y ralentizarla. Obtén más información aquí.
¿Es Clojure Reactive Programming un PDF/ePUB en línea?
Sí, puedes acceder a Clojure Reactive Programming de Leonardo Borges en formato PDF o ePUB, así como a otros libros populares de Ciencia de la computación y Lenguajes de programación. Tenemos más de un millón de libros disponibles en nuestro catálogo para que explores.

Información

Año
2015
ISBN
9781783986668

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

Índice