vinhnglx / vinhnglx.github.io

0 stars 0 forks source link

TIL_17_Jul_2017 - Phoenix programming - Part 1 - Basic structure #20

Open vinhnglx opened 7 years ago

vinhnglx commented 7 years ago

There's a side benefit, pipelines are also functions - means you can make pipelines of pipelines. For example, what a Phoenix program might look like, using pipelines:

connection |> phoenix
vinhnglx commented 7 years ago
vinhnglx commented 7 years ago
[debug] Processing by Kitty.HelloController.world/2
  Parameters: %{"name" => "vincent"}
  Pipelines: [:browser]

This is an example about process a parameter from outside in Phoenix. The external parameters have string key "name" => "vincent", because external data can't safely be converted to atoms, because the atom table isn't garbage-collected.

vinhnglx commented 7 years ago

This means atoms should not be generated dynamically for whatever reason;

vinhnglx commented 7 years ago