<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>erlang on Poeticoding</title><link>https://www.poeticoding.com/tag/erlang/</link><description>Recent content in erlang on Poeticoding</description><generator>Hugo</generator><language>en</language><lastBuildDate>Mon, 21 Oct 2019 13:39:56 +0000</lastBuildDate><atom:link href="https://www.poeticoding.com/tag/erlang/index.xml" rel="self" type="application/rss+xml"/><item><title>Hey Process, there is a Message for you!</title><link>https://www.poeticoding.com/hey-process-there-is-a-message-for-you/</link><pubDate>Wed, 13 Mar 2019 16:21:23 +0000</pubDate><guid>https://www.poeticoding.com/hey-process-there-is-a-message-for-you/</guid><description>&lt;p>&lt;a href="https://www.poeticoding.com/spawning-processes-in-elixir-a-gentle-introduction-to-concurrency/">We already saw how to spawn new processes&lt;/a> to run our code concurrently, doing multiple HTTP requests at the same time, getting cryptocurrency prices.&lt;/p>
&lt;p>Without messages and coordination between processes, the only way to see the results was to let each process printing each price once finished.&lt;/p></description></item><item><title>Spawning processes in Elixir, a gentle introduction to concurrency</title><link>https://www.poeticoding.com/spawning-processes-in-elixir-a-gentle-introduction-to-concurrency/</link><pubDate>Wed, 06 Mar 2019 12:35:26 +0000</pubDate><guid>https://www.poeticoding.com/spawning-processes-in-elixir-a-gentle-introduction-to-concurrency/</guid><description>&lt;p>Along with &lt;a href="https://www.poeticoding.com/the-beauty-of-pattern-matching-in-elixir/">pattern matching&lt;/a>, one of the coolest things in Erlang and Elixir is &lt;a href="https://en.wikipedia.org/wiki/Actor_model" target="_blank" rel="noopener">their concurrency implementation based on Actor model&lt;/a>. In this article I introduce concurrency and show how we can start making our code concurrent in Elixir, using processes.&lt;/p>
&lt;h2 id="concurrency">Concurrency&lt;/h2>
&lt;p>We can think of concurrency as dealing with multiple things happening, and progressing, at the same time.&lt;/p></description></item><item><title>Aggregate and Count Real-Time Trades with Elixir Maps</title><link>https://www.poeticoding.com/counting-realtime-trades/</link><pubDate>Fri, 28 Dec 2018 16:13:58 +0000</pubDate><guid>https://www.poeticoding.com/counting-realtime-trades/</guid><description>&lt;p>In the &lt;a href="https://www.poeticoding.com/realtime-market-data-updates-with-elixir/">Real-time Market-Data Updates with Elixir&lt;/a> article, we have seen how to build a Coinbase WebSocket client and receive real-time trades. In the comments of the article, a reader asked how many trades we receive per second. In general, the rate of trades depends on the product and the time of day.
In this article we start to see how to aggregate these trades in real-time, using the GenServer behaviour. We&amp;rsquo;ll build an aggregation process that groups and count the trades.&lt;/p></description></item><item><title>Build a Simple Persistent Key-Value Store in Elixir, using Logs - Part 2</title><link>https://www.poeticoding.com/build-a-simple-persistent-key-value-store-in-elixir-using-logs-part-2/</link><pubDate>Tue, 04 Dec 2018 16:40:00 +0000</pubDate><guid>https://www.poeticoding.com/build-a-simple-persistent-key-value-store-in-elixir-using-logs-part-2/</guid><description>&lt;p>Published articles in the series:&lt;/p>
&lt;ol>
&lt;li>&lt;a href="https://www.poeticoding.com/build-a-simple-persistent-key-value-store-in-elixir-using-logs-part-1/">Part 1&lt;/a>&lt;/li>
&lt;li>Part 2 (this article)&lt;/li>
&lt;/ol>
&lt;p>In the &lt;a href="https://www.poeticoding.com/build-a-simple-persistent-key-value-store-in-elixir-using-logs-part-1/">part 1&lt;/a>, we&amp;rsquo;ve introduced a simple implementation of a kv-store engine, written in Elixir. We developed three modules: an &lt;em>Index&lt;/em>, a &lt;em>Writer&lt;/em> and a &lt;em>Reader&lt;/em>. The Writer writers the &lt;em>values&lt;/em> in a log-file keeping the keys in a in-memory Index. Since the state of the index is only kept in memory, once the index process fails, or the whole engine crashes, we are not able to distinguish the values &amp;hellip;&lt;/p></description></item></channel></rss>