舉報

會員
Mastering Elixir
Runningconcurrent,fault-tolerantapplicationsthatscaleisaverydemandingresponsibility.AfterlearningtheabstractionsthatElixirgivesus,developersareabletobuildsuchapplicationswithinconceivableloweffort.ThereisabiggapbetweenplayingaroundwithElixirandrunningitinproduction,servingliverequests.ThisbookwillhelpyoufllthisgapbygoingintodetailonseveralaspectsofhowElixirworksandshowingconcreteexamplesofhowtoapplytheconceptslearnedtoafullyfledgedapplication.Inthisbook,youwilllearnhowtobuildarock-solidapplication,beginningbyusingMixtocreateanewproject.ThenyouwilllearnhowtheuseofErlang'sOTP,alongwiththeElixirabstractionsthatrunontopofit(suchasGenServerandGenStage),thatallowyoutobuildapplicationsthatareeasytoparallelizeanddistribute.Youwillalsomastersupervisors(andsupervisiontrees),andcomprehendhowtheyarethebasisforbuildingfault-tolerantapplications.ThenyouwillusePhoenixtocreateawebinterfaceforyourapplication.Uponfnishingimplementation,youwilllearnhowtotakeyourapplicationtothecloud,usingKubernetestoautomaticallydeploy,scale,andmanageit.Last,butnotleast,youwillkeepyourpeaceofmindbylearninghowtothoroughlytestandthenmonitoryourapplication.
目錄(235章)
倒序
- 封面
- Title Page
- Copyright and Credits
- Mastering Elixir
- Dedication
- Packt Upsell
- Why subscribe?
- PacktPub.com
- Contributors
- About the authors
- About the reviewer
- Packt is searching for authors like you
- Preface
- Who this book is for
- What this book covers
- To get the most out of this book
- Download the example code files
- Conventions used
- Get in touch
- Reviews
- Preparing for the Journey Ahead
- Why functional programming?
- Elixir and Erlang
- Elixir's data types
- Integers
- Floats
- Atoms
- Booleans
- Tuples
- Lists
- Maps
- Binaries
- Strings and charlists
- Other types
- Keyword lists
- Ranges
- MapSets
- Pattern matching
- Pattern matching on tuples
- Pattern matching on lists
- Pattern matching on maps
- Pattern matching on binaries and strings
- Functions and Modules
- Anonymous functions
- Modules and Named Functions
- Module attributes directives and uses
- Working with collections
- Looping through recursion
- Eager processing with the Enum module
- Comprehensions
- Lazy processing with the stream module
- Control flow
- if and unless
- cond
- case
- with
- Exceptions
- Typespecs and behaviours
- Typespecs
- Dialyzer
- Behaviours
- Protocols
- Structs
- Bringing structs and protocols together
- Tooling and ecosystems
- IEx
- Mix
- ExUnit
- Erlang interoperability
- Summary
- Innards of an Elixir Project
- Elixir applications
- Elixir project structure
- Project dependencies
- Umbrella projects
- ElixirDrip – our showcase application
- Using behaviours
- Viewing cross references with xref
- Adopting a consistent coding style
- Summary
- Processes – The Bedrock of Concurrency and Fault Tolerance
- Inside the BEAM
- Working with processes
- Creating processes
- Message passing between processes
- Building a cache worker
- Detecting errors by linking and monitoring processes
- Using links
- Using monitors
- Recovering from errors with supervisors and supervision trees
- Defining and starting a supervisor
- Streamlined child specs
- Starting children at runtime using dynamic supervisors
- Minimizing error effects with supervision trees
- Summary
- Powered by Erlang/OTP
- GenServer
- GenServer at your service
- Implementing a CacheWorker with GenServer
- Agent
- Task
- Parallel tasks
- Using (D)ETS
- Disk-based ETS
- Registry
- Summary
- Demand-Driven Processing
- GenStage
- The upload pipeline
- The notifier stage
- The RemoteStorage stage
- The Encryption stage
- The Starter stage
- The download pipeline
- The Notifier stage
- The Encryption stage
- The RemoteStorage stage
- The Starter stage
- Final remarks
- Flow
- Sample data
- Lazy queries
- Disk-usage rank query
- Summary
- Metaprogramming – Code That Writes Itself
- The abstract syntax tree
- Tinkering with macros
- Hygienic accesses
- Famous (un)quotes
- Macros – a silver bullet?
- Extending modules
- Using the use and __using__/1 macros
- Creating a domain-specific language
- Registering module attributes
- Collecting a list of pipeline steps
- Generating worker specs and subscription options
- Producer stage
- ProducerConsumer and Consumer stages
- Collecting the pipeline worker specs
- Defining the supervisor functions
- Streamlining GenStage modules
- Simpler pipeline producers
- Simpler pipeline (producer) consumers
- Macros cheat sheet
- Summary
- Persisting Data Using Ecto
- Connecting to the database
- Schemas and migrations
- Schemas
- Custom field types
- Users or media owners?
- Schema or not – that is the question
- Migrations
- Relationships
- Changesets
- Media
- Users
- Media ownership
- Constraints
- Queries
- Media folder queries
- Loading schemas and their associations
- Queries with raw SQL
- Finding top users with aggregates
- Summary
- Phoenix – A Flying Web Framework
- The Plug specification
- Creating a module plug
- Creating a function plug
- Routing requests
- Handling requests in a controller
- Rendering views
- Layouts
- Authenticating users
- Implementing a JSON API
- Authenticating users in the API
- Interactive applications using channels
- Preparing the server
- Joining channels on the client
- Exchanging events
- Authenticating socket connections
- Tracking users statuses using Presence
- Summary
- Finding Zen through Testing
- Unit testing
- Testing functions without side-effects
- Testing functions with side-effects
- Creating mocks with Mox
- Testing interactions with the repository separately
- Testing the documentation
- Integration testing
- Testing Phoenix Channels
- Testing macros
- Property-based testing
- Summary
- Deploying to the Cloud
- Releasing with Distillery
- Configuring the release
- Interpolating environment variables
- Creating the release
- Creating a custom release task
- Containerizing our application
- Creating a development container
- Orchestrating more than one container
- Composing the deployment containers
- Deploying to Kubernetes
- Configuring the cloud database
- Creating a namespace
- Creating secrets
- Publishing the production image
- Deploying your first pod
- Creating a Kubernetes job
- Exposing your pods to the world
- Continuous deployment with Travis CI
- Connecting the deployed Elixir nodes
- Testing the connected nodes
- Summary
- Keeping an Eye on Your Processes
- Collecting metrics
- Exposing Prometheus metrics
- Creating custom Prometheus metrics
- Local Prometheus server
- Deploying Prometheus in Kubernetes
- Calculating percentiles
- Setting Grafana variables
- A window to your nodes
- Connecting to a containerized node
- Connecting to an Erlang node running in Kubernetes
- Using a remote shell
- Inspecting application behavior
- Profiling with the fprof profiler
- Tracing with the :dbg module
- Summary
- Other Books You May Enjoy
- Leave a review - let other readers know what you think 更新時間:2021-08-05 10:43:26
推薦閱讀
- JSP網(wǎng)絡(luò)編程(學(xué)習(xí)筆記)
- 零基礎(chǔ)玩轉(zhuǎn)區(qū)塊鏈
- Mastering macOS Programming
- Java程序設(shè)計
- Getting Started with Laravel 4
- Android Wear Projects
- OpenResty完全開發(fā)指南:構(gòu)建百萬級別并發(fā)的Web應(yīng)用
- ElasticSearch Cookbook(Second Edition)
- ScratchJr趣味編程動手玩:讓孩子用編程講故事
- Python網(wǎng)絡(luò)爬蟲技術(shù)與應(yīng)用
- Deep Learning for Natural Language Processing
- Arduino Electronics Blueprints
- Beginning PHP
- Appcelerator Titanium Smartphone App Development Cookbook
- 軟件測試項目實(shí)戰(zhàn)之功能測試篇
- 嵌入式Linux與物聯(lián)網(wǎng)軟件開發(fā):C語言內(nèi)核深度解析
- 亮劍C#項目開發(fā)案例導(dǎo)航
- Developing Multi:Platform Apps with Visual Studio Code
- Java 8實(shí)戰(zhàn)
- 編程真酷:Scratch3.0游戲創(chuàng)作之旅
- SignalR Blueprints
- Microsoft Power BI Cookbook
- 你好,C語言
- 零基礎(chǔ)學(xué)交互設(shè)計
- 碼農(nóng)修行:編寫優(yōu)雅代碼的32條法則
- Access 2010基礎(chǔ)教程
- React+Redux前端開發(fā)實(shí)戰(zhàn)
- Cross-platform UI Development with Xamarin.Forms
- PHP 7.0+MySQL網(wǎng)站開發(fā)全程實(shí)例
- Scratch項目式編程實(shí)戰(zhàn):打造超酷大型游戲