Section 1

Preview this deck

Supervisor

Front

Star 0%
Star 0%
Star 0%
Star 0%
Star 0%

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Active users

0

All-time users

0

Favorites

0

Last updated

6 years ago

Date created

Mar 1, 2020

Cards (46)

Section 1

(46 cards)

Supervisor

Front

Given a list of processes to monitor and told what to do if a process dies, and how to prevent restart loops.

Back

Eex

Front

Executes Elixir code that's within <%= %> tags, injecting the result into the template. Eex evaluates code between <% %> tags without injecting the result.

Back

Importance of Concurrency

Front

CPUs are not getting faster, just more cores. Software must now take on the complexity of using the cores. Traditionally, if multiple cores try to access and manipulate the same piece of memory, they can corrupt the memory unless synchronization is used. Synchronization is painful, error prone, tiresome, and can hurt performance.

Back

inputs_for

Front

Enables the definition of nested input forms for our credentials.

Back

OTP

Front

Open Telecom Platform addresses application discovery, failure detection and management, hot code swapping, and server structure.

Back

Elixir List

Front

. Linked data structure . Consists of head and tail, like Lisp . Key can be repeated . Use for passing parameters

Back

Rings of Confidence

Front

Enhance Fault Tolerance Outer ring, where code interacts with the world, should be as reliable as possible. Inner rings can be nested to handle less perfect situations. Goal is to ensure that each ring can deal with the failures of the next ring down.

Back

Phoenix framework helps production concerns

Front

. Erlang VM and OTP engine will help the application scale . Endpoint filters out static requests, parses the request into pieces, and triggers the router . Browser pipeline will honor Accept requests, fetch the session, and protect against Cross-Site Request Forgery

Back

Render in Controller

Front

. First Renders the layout view . Second renders the actual template in a predefined markup

Back

Phoenix link

Front

link(text, opts) text: user view of the link opts: . :to - page to link to - required . :method - :get by default and uses <a> tabs. If not :get, the link is wrapped in a form.

Back

Elixir Map

Front

. Collection of key/value pairs . Only one entry per key . Use for associative arrays

Back

ecto.migrate

Front

Migrates the database for your current environment. To change the environment you have to change the MIX_ENV operating system environment variable.

Back

Elixir Behaviors

Front

4 Behaviors: . General purpose server . Event handler . Finite state machines . Supervisors

Back

Agent/Task vs GenServer

Front

Agents/tasks are great when dealing with very specific background activities GenServers are general processes

Back

Elixir Application

Front

. One or more processes . Bundle of code that comes with a descriptor. The descriptor tells the runtime what dependencies the code has, what global names it registers, etc.

Back

mix.lock

Front

Includes the specific versions of the libraries the app depends on. The guarantees that the production machines use exactly the same versions that we used during development and in our build servers.

Back

Modules

Front

. Provide namespace for things you define . Act as a wrapper for macros, structs, protocols, and other modules

Back

Concurrency

Front

One channel can never block another one, whether code is waiting on the database or crunching data.

Back

Object Oriented vs Functional Thinking

Front

With objects with think about hierarchies, classes, and data hiding. With functions we think about transforming data. A function transforms its inputs into its outputs.

Back

Phoenix Template

Front

A function compiled from a file containing raw markup and embedded Elixir code to process substitutions and loops. Templates are web pages or fragments that allow both static markup and native code to build response pages, compiled into a function.

Back

Ecto queries

Front

If you want something from Ecto, you have to explicitly ask for it.

Back

Enumerable vs Collectable

Front

Enumerable Protocol - iterate over elements of a type Collectable - build a collection by inserting elements into it

Back

Ecto Changeset

Front

Holds all of the changes you want to perform on the database. It encapsulates the whole process of receiving external data, casting and validating it before writing to the database. Changesets manage record changes, cast parameters, and perform validations. Use a Changeset to build a customized strategy for dealing with specific types of changes. Use one changeset for each use case.

Back

Ecto Update Strategies

Front

The changeset lets Ecto decouple update policy from the schema, and therefore you can handle each update policy in its own separate changeset function.

Back

conn.assigns in a View

Front

Everything in conn.assigns is available in our views.

Back

Elixir Stream

Front

Enumerates a collection lazily, meaning you can pass a stream a function. Streams are composable.

Back

Primitive List vs List Module

Front

Primitive List - an implementation List Module - adds a layer of abstraction

Back

Run App in iex

Front

iex -S mix phx.server

Back

Model Attributes

Front

Elixir modules have associated metadata. The metadata is called an attribute and is identified by a name. Access the attribute with the @ symbol.

Back

Plug.Conn

Front

A struct that represents the whole universe for a given request, because it has the inbound request, the protocol, the parsed parameters, etc.

Back

Closure

Front

. Functions automatically carry the bindings of variables in the scope in which they were defined. . Scope encloses the bindings of its variables, packaging them into something that can be saved and used later.

Back

Phoenix View

Front

A module that contains rendering functions that convert data into a format the end user will consume. Views are responsible for rendering.

Back

Virtual Schema Fields

Front

Exist in the Ecto struct but not in the database. Use these in cases where you want to get something from the user but persist something different to the database - such as password vs password-hash.

Back

Resource Routes

Front

Resources is a shorthand implementation for the common set of actions that follow a REST convention.

Back

Two kinds of Plugs

Front

. Module plugs is a module that implements two functions: init and call . Function plugs is a single function

Back

Solve the form_for coupling problem

Front

A protocol called Phoenix.HTML.Form-Data separates the interface from the implementation. Ecto.changeset implements this protocol to convert its internal data to the structure required by Phoenix forms.

Back

Elixir Atom

Front

An atom's name is its value. Two atoms with the same name will always compare as being equal.

Back

Import / Alias / Require

Front

Import - Brings a module's functions and/or macros into the current scope. Alias - Creates an alias, used to cut down on typing Require - Use any macros defined in a module

Back

Erlang Message Passing

Front

. Processes talk to each other via messages . Exchanging messages between different machines on the same network is handled transparently by the VM

Back

Create a new Phoenix App

Front

mix phx.new <app name>

Back

Isolation

Front

If a bug affects one channel, all other channels continue running.

Back

Elixir Processes

Front

Data is divvied up between processes, so each heap is much smaller than when all data is in the same heap. Garbage collection runs faster. When a process terminates, the data is discarded, and no garbage collection is needed.

Back

Phoenix Context

Front

Dedicated modules that expose and group related functionality. A context can group related functionality, as well as encapsulate patters such as data access and data validation.

Back

Actor Model

Front

Independent process that shares nothing with any other process. Spawn a process; Send it messages; Receive messages back

Back

Plug

Front

. Plug library is a specification for building applications on the web. Each plug consumes and produces a common data structure called Plug.Conn . Plugs are functions. Web applications are pipelines of plugs.

Back

When to use a Stream

Front

Streams support resources that are asynchronous. Use a Stream to defer processing until needed, and dealing with large numbers of things not all at once.

Back