This document summarizes GenStage and Flow, libraries for building concurrent and distributed data processing pipelines in Elixir. It begins with an example word counting problem and shows solutions using eager, lazy, and concurrent approaches. GenStage implements a demand-driven producer-consumer model with backpressure. Flow provides map, reduce, and windowing operations to process data across concurrent stages. While Flow provides parallelism, it does not currently support distribution; the document discusses related work that could inspire future distributed capabilities.
Phoenix is productive, reliable, fast web framework. In this presentation, we will be talking about what making Phoenix unique. We will discuss using OTP features alongside with Phoenix.Endpoint. Also, we will discuss Phoenix future changes.
Elixir Meetup 4 Lviv (17.12.2016)
Phoenix is productive, reliable, fast web framework. In this presentation, we will be talking about what making Phoenix unique. We will discuss using OTP features alongside with Phoenix.Endpoint. Also, we will discuss Phoenix future changes.
Elixir Meetup 4 Lviv (17.12.2016)
Building a Network IP Camera using ErlangFrank Hunleth
This is my Erlang Factory SF 2014 talk on using the Nerves project to make a streaming IP camera with the Beaglebone Black and a custom image sensor cape. The presentation provides throughput, latency, and memory usage measurements to motivate using Erlang in embedded Linux-based devices.
In the Ruby world, a “test-unit” was the first testing library with simple DSL and set of “assertions”. As our applications became larger and more complex, we needed more powerful test frameworks. The concepts of testings also changed. Behaviour Driven Development approach shifted the testing focus from structure to behaviour. These new testing requirements brought RSpec into the Ruby world. The same happened to many other programming languages. Even though Elixir is a very young programming language, now is really the time for powerful BDD testing frameworks.
Metaprogramming - the process of using code to write code - is a core feature of Elixir. You can easily extend the language and dynamically change the code. Despite knowing the first rule of metaprogramming - "Don't use metaprogramming" - every Elixir developer should have an idea what it is.
This talk will introduce the audience to the main metaprogramming concepts of Elixir. You will know about Elixir abstract syntax tree, 'quoting', macros and compile-time hooks. I'll demonstrate how this stuff works using simple examples as well as cases from popular packages.
First Kyiv Elixir Meetup, June 23
In this presentation I want to look at Spark as at some sort of Scala evolution. We will consider basic Scala features and then map some of them into Spark features.
www.fruzenshtein.com
This presentation was recorded as part of the ELIXIR Webinar series and can be viewed at http://www.elixir-europe.org/documents/elixir-webinar%3A-introducing-tess-february-2017 - The presentation covers an introduction to the ELIXIR Training platform TeSS - some of it's features, functions and future works. It also has a whistle-top tour of Bioschemas - the group developing schema.org for the Life sciences.
WEB MINING: PATTERN DISCOVERY ON THE WORLD WIDE WEB - 2011Mustafa TURAN
Web Mining: Pattern Discovery on the World Wide Web
The study covers auto Turkish text content gathering from most popular social media platforms (twitter, facebook, blogs, news, etc...) and auto classifying sentimentally those contents.
A brief explanation about antibody based proteome arrays. The mechanism and functional units behind it. The labelling technology used in proteome array experiments. the detection and data analysis of the proteome array is also explained.
Building a Network IP Camera using ErlangFrank Hunleth
This is my Erlang Factory SF 2014 talk on using the Nerves project to make a streaming IP camera with the Beaglebone Black and a custom image sensor cape. The presentation provides throughput, latency, and memory usage measurements to motivate using Erlang in embedded Linux-based devices.
In the Ruby world, a “test-unit” was the first testing library with simple DSL and set of “assertions”. As our applications became larger and more complex, we needed more powerful test frameworks. The concepts of testings also changed. Behaviour Driven Development approach shifted the testing focus from structure to behaviour. These new testing requirements brought RSpec into the Ruby world. The same happened to many other programming languages. Even though Elixir is a very young programming language, now is really the time for powerful BDD testing frameworks.
Metaprogramming - the process of using code to write code - is a core feature of Elixir. You can easily extend the language and dynamically change the code. Despite knowing the first rule of metaprogramming - "Don't use metaprogramming" - every Elixir developer should have an idea what it is.
This talk will introduce the audience to the main metaprogramming concepts of Elixir. You will know about Elixir abstract syntax tree, 'quoting', macros and compile-time hooks. I'll demonstrate how this stuff works using simple examples as well as cases from popular packages.
First Kyiv Elixir Meetup, June 23
In this presentation I want to look at Spark as at some sort of Scala evolution. We will consider basic Scala features and then map some of them into Spark features.
www.fruzenshtein.com
This presentation was recorded as part of the ELIXIR Webinar series and can be viewed at http://www.elixir-europe.org/documents/elixir-webinar%3A-introducing-tess-february-2017 - The presentation covers an introduction to the ELIXIR Training platform TeSS - some of it's features, functions and future works. It also has a whistle-top tour of Bioschemas - the group developing schema.org for the Life sciences.
WEB MINING: PATTERN DISCOVERY ON THE WORLD WIDE WEB - 2011Mustafa TURAN
Web Mining: Pattern Discovery on the World Wide Web
The study covers auto Turkish text content gathering from most popular social media platforms (twitter, facebook, blogs, news, etc...) and auto classifying sentimentally those contents.
A brief explanation about antibody based proteome arrays. The mechanism and functional units behind it. The labelling technology used in proteome array experiments. the detection and data analysis of the proteome array is also explained.
How fast ist it really? Benchmarking in practiceTobias Pfeiffer
“What’s the fastest way of doing this?” - you might ask yourself during development. Sure, you can guess what’s fastest or how long something will take, but do you know? How long does it take to sort a list of 1 Million elements? Are tail-recursive functions always the fastest?
Benchmarking is here to answer these questions. However, there are many pitfalls around setting up a good benchmark and interpreting the results. This talk will guide you through, introduce best practices and show you some surprising benchmarking results along the way.
Elixir flow: Building and tuning concurrent workflowsLuke Galea
How to use Elixir Flow to build concurrent workflows and tune them for optimal performance. Covers taking eager code and making it lazy, then concurrent and parallel. Some brief discussion on GenStage.
Simply Business is starting to look into new tools to improve some of our mission-critical systems. There is one application, which would hugely benefit from the concurrency and fault tolerance model offered by languages like Elixir.
To increase awareness and gauge interest in the technology, we will have a bootcamp dedicated to giving us more insights into how to build and architect applications using Elixir and OTP.
It is meant to aim for slightly more advanced concepts, so in order to prepare rest of the team to be able to read the code and have some basic understanding of constructs and tooling - we have organised a LevelUP session, to talk exactly about that...
Ejercicios de estilo en la programaciónSoftware Guru
El escritor francés Raymond Queneau escribió a mediados del siglo XX un libro llamado "Ejercicios de Estilo" donde mostraba una misma historia corta, redactada de 99 formas distintas.
En esta plática realizaremos el mismo ejercicio con un programa de software. Abarcaremos distintos estilos y paradigmas: programación monolítica, orientada a objetos, relacional, orientada a aspectos, monadas, map-reduce, y muchos otros, a través de los cuales podremos apreciar la riqueza del pensamiento humano aplicado a la computación.
Esto va mucho más allá de un ejercicio académico; el diseño de sistemas de gran escala se alimenta de esta variedad de estilos. También platicaremos sobre los peligros de quedar atrapado bajo un conjunto reducido de estilos a lo largo de tu carrera, y la necesidad de verdaderamente entender distintos estilos al diseñar arquitecturas de sistemas de software.
Semblanza del conferencista:
Crista Lopez es profesora en la Facultad de Ciencias Computacionales de la Universidad de California en Irvine. Su investigación se enfoca en prácticas de ingeniería de software para sistemas de gran escala. Previamente, fue miembro fundador del equipo en Xerox PARC creador del paradigma de programación orientado a aspectos (AOP). Crista es una de las desarrolladoras principales de OpenSimulator, una plataforma open source para crear mundos virtuales 3D. También es fundadora de Encitra, empresa especializada en la utilización de la realidad virtual para proyectos de desarrollo urbano sustentable. @cristalopes
Coroutine Flows are the new hot tech in reactive apps.
They are very powerful and easy to use at the same time. the best part is they support KMP so we can share our flows with other platforms.
In this talk, I go through different flow operators and flow types (ex: SharedFlow, StateFlow, and …).
I explain their usage and compare their subtle differences.
I also cover how we can leverage Coroutines Flow and its operators to build reactive architectures.
No talk should be ended without talking about testing.
In this talk, I’ll explain how we can write readable and concise tests with Kotlin Flows that run on all platforms.
Big Data Day LA 2016/ Hadoop/ Spark/ Kafka track - Iterative Spark Developmen...Data Con LA
This presentation will explore how Bloomberg uses Spark, with its formidable computational model for distributed, high-performance analytics, to take this process to the next level, and look into one of the innovative practices the team is currently developing to increase efficiency: the introduction of a logical signature for datasets.
Kubernetes + Docker + Elixir - Alexei Sholik, Andrew Dryga | Elixir Club UkraineElixir Club
Kubernetes + Docker + Elixir - Alexei Sholik, Andrew Dryga
Slides of Alexei Sholik, Andrew Dryga, at Lightning Talk session at Elixir Club Ukraine, Kyiv, 28.09.2019
Next conference - http://www.elixirkyiv.club/
Follow us on social networks @ElixirClubUA and #ElixirClubUA
Announce and materials from conf - https://www.fb.me/ElixirClubUA
News - https://twitter.com/ElixirClubUA
Photo and free atmosphere - https://www.instagram.com/ElixirClubUA
*Organizer’s channel - https://t.me/incredevly
Integrating 3rd parties with Ecto - Eduardo Aguilera | Elixir Club UkraineElixir Club
Slides of Eduardo Aguilera, Elixir developer at The Coingaming Group, at Elixir Club Ukraine, Kyiv, 28.09.2019
Next conference - http://www.elixirkyiv.club/
Description of presentation
Only a handful of systems can work on their own, and most of the time this external parties are out of your control, this is why how your application communicates with them is crucial for everything to work smoothly.
Ecto is an incredibly powerful data validation tool, and in this talk I will show you how we use it to make our integrations consistent, catching any error before the request goes out of your realm.
Follow us on social networks @ElixirClubUA and #ElixirClubUA
Announce and materials from conf - https://www.fb.me/ElixirClubUA
News - https://twitter.com/ElixirClubUA
Photo and free atmosphere - https://www.instagram.com/ElixirClubUA
*Organizer’s channel - https://t.me/incredevly
— An async template - Oleksandr Khokhlov | Elixir Club UkraineElixir Club
Slides of Oleksandr Khokhlov, Founder at Nots.io, at Elixir Club Ukraine, Kyiv, 28.09.2019
Next conference - http://www.elixirkyiv.club/
Description of presentation
Elixir and Erlang platform are all about asynchronous communications. Why don’t we use this feature while rendering templates? In this talk, Oleksandr unveils how we in Nots.io split HTML documents into smaller pieces and render them in parallel.
Follow us on social networks @ElixirClubUA and #ElixirClubUA
Announce and materials from conf - https://www.fb.me/ElixirClubUA
News - https://twitter.com/ElixirClubUA
Photo and free atmosphere - https://www.instagram.com/ElixirClubUA
*Organizer’s chanel - https://t.me/incredevly
BEAM architecture handbook - Andrea Leopardi | Elixir Club UkraineElixir Club
Slides of Andrea Leopardi, member of the @elixir-lang core team, at Elixir Club Ukraine, Kyiv, 28.09.2019
Next conference - http://www.elixirkyiv.club/
Description of presentation
If you are writing a stateless web application backed up by a database, there is a good chance Elixir is a great fit. However, this is not where it shines. In this talk, we will discuss how to architect Elixir applications in order to leverage the features of the language and of its runtime.
We will look at this both from a lower level, talking about the architecture of processes inside an Elixir application, as well as from a higher perspective of writing Elixir services and architecting systems to play to Elixir's strengths.
We will see practical use cases and discuss design patterns.
Follow us on social networks @ElixirClubUA and #ElixirClubUA
Announce and materials from conf - https://www.fb.me/ElixirClubUA
News - https://twitter.com/ElixirClubUA
Photo and free atmosphere - https://www.instagram.com/ElixirClubUA
*Organizer’s channel - https://t.me/incredevly
You ain't gonna need write a GenServer - Ulisses Almeida | Elixir Club UkraineElixir Club
Slides of Ulisses Almeida, Elixir Developer at The Coingaming Group, at Elixir Club Ukraine, Kyiv, 28.09.2019
Next conference - http://www.elixirkyiv.club/
Description of presentation
GenServers plays a central role in Elixir OTP applications.
However, when you overuse it, it can become an anti-pattern and introduce bottlenecks in your system.
In this talk you'll learn:
* What's a GenServer
* When GenServer can harm
* GenServer FOMO (fear of missing out)
* How Elixir ecosystem get you covered
After this talk, you'll understand how putting a GenServer in the wrong place can slowdown in your entire system.
You'll understand how the Elixir frameworks and libraries enable you to have reliable concurrency applications.
You'll feel no shame of being an Elixir developer and never had to write yourself a GenServer.
Follow us on social networks @ElixirClubUA and #ElixirClubUA
Announce and materials from conf - https://www.fb.me/ElixirClubUA
News - https://twitter.com/ElixirClubUA
Photo and free atmosphere - https://www.instagram.com/ElixirClubUA
*Organizer’s channel - https://t.me/incredevly
— Knock, knock — An async templates — Who’s there? - Alexander Khokhlov | ...Elixir Club
Доповідь Олександра Хохлова, Founder Nots.io, на Elixir Club 13, Dnipro, 13.04.2019
Наступна конференція - http://www.elixirkyiv.club/
Elixir and Erlang platform are all about asynchronous communications. Why don’t we use this feature while rendering templates? In this talk, Alexander unveils how we in Nots.io split HTML documents into smaller pieces and render them in parallel.
Cлідкуйте за нами у соцмережах @ElixirClubUA та #ElixirClubUA
Анонси та матеріали конференцій - https://www.fb.me/ElixirClubUA
Новини - https://twitter.com/ElixirClubUA
Фото та невимушена атмосфера - https://www.instagram.com/ElixirClubUA
*Канал організаторів мітапа - https://t.me/incredevly
Performance measurement methodology — Maksym Pugach | Elixir Evening Club 3Elixir Club
Доповідь Максима Пугача, Team Lead/Software Engineer at LITSLINK, на Elixir Evening Club 3, Kyiv, 13.12.2018
Наступна конференція - http://www.elixirkyiv.club/
A boss of mine once told me "Just see, my poorly written Vert.x app outperforms my poorly written Elixir app". Now it is time to take up the gauntlet.
Cлідкуйте за нами у соцмережах @ElixirClubUA та #ElixirClubUA
Анонси та матеріали конференцій - https://www.fb.me/ElixirClubUA
Новини - https://twitter.com/ElixirClubUA
Фото та невимушена атмосфера - https://www.instagram.com/ElixirClubUA
*Канал організаторів мітапа - https://t.me/incredevly
Erlang cluster. How is it? Production experience. — Valerii Vasylkov | Elixi...Elixir Club
Доповідь Валерія Василькова, Founder at Digitbay, на Elixir Evening Club 3, Kyiv, 13.12.2018
Наступна конференція - http://www.elixirkyiv.club/
We will talk about Erlang distribution under the hood. Use cases, production usage and maintenance.
Cлідкуйте за нами у соцмережах @ElixirClubUA та #ElixirClubUA
Анонси та матеріали конференцій - https://www.fb.me/ElixirClubUA
Новини - https://twitter.com/ElixirClubUA
Фото та невимушена атмосфера - https://www.instagram.com/ElixirClubUA
*Канал організаторів мітапа - https://t.me/incredevly
Enhancing Research Orchestration Capabilities at ORNL.pdfGlobus
Cross-facility research orchestration comes with ever-changing constraints regarding the availability and suitability of various compute and data resources. In short, a flexible data and processing fabric is needed to enable the dynamic redirection of data and compute tasks throughout the lifecycle of an experiment. In this talk, we illustrate how we easily leveraged Globus services to instrument the ACE research testbed at the Oak Ridge Leadership Computing Facility with flexible data and task orchestration capabilities.
Navigating the Metaverse: A Journey into Virtual Evolution"Donna Lenk
Join us for an exploration of the Metaverse's evolution, where innovation meets imagination. Discover new dimensions of virtual events, engage with thought-provoking discussions, and witness the transformative power of digital realms."
Large Language Models and the End of ProgrammingMatt Welsh
Talk by Matt Welsh at Craft Conference 2024 on the impact that Large Language Models will have on the future of software development. In this talk, I discuss the ways in which LLMs will impact the software industry, from replacing human software developers with AI, to replacing conventional software with models that perform reasoning, computation, and problem-solving.
Globus Connect Server Deep Dive - GlobusWorld 2024Globus
We explore the Globus Connect Server (GCS) architecture and experiment with advanced configuration options and use cases. This content is targeted at system administrators who are familiar with GCS and currently operate—or are planning to operate—broader deployments at their institution.
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...Anthony Dahanne
Les Buildpacks existent depuis plus de 10 ans ! D’abord, ils étaient utilisés pour détecter et construire une application avant de la déployer sur certains PaaS. Ensuite, nous avons pu créer des images Docker (OCI) avec leur dernière génération, les Cloud Native Buildpacks (CNCF en incubation). Sont-ils une bonne alternative au Dockerfile ? Que sont les buildpacks Paketo ? Quelles communautés les soutiennent et comment ?
Venez le découvrir lors de cette session ignite
Experience our free, in-depth three-part Tendenci Platform Corporate Membership Management workshop series! In Session 1 on May 14th, 2024, we began with an Introduction and Setup, mastering the configuration of your Corporate Membership Module settings to establish membership types, applications, and more. Then, on May 16th, 2024, in Session 2, we focused on binding individual members to a Corporate Membership and Corporate Reps, teaching you how to add individual members and assign Corporate Representatives to manage dues, renewals, and associated members. Finally, on May 28th, 2024, in Session 3, we covered questions and concerns, addressing any queries or issues you may have.
For more Tendenci AMS events, check out www.tendenci.com/events
How Recreation Management Software Can Streamline Your Operations.pptxwottaspaceseo
Recreation management software streamlines operations by automating key tasks such as scheduling, registration, and payment processing, reducing manual workload and errors. It provides centralized management of facilities, classes, and events, ensuring efficient resource allocation and facility usage. The software offers user-friendly online portals for easy access to bookings and program information, enhancing customer experience. Real-time reporting and data analytics deliver insights into attendance and preferences, aiding in strategic decision-making. Additionally, effective communication tools keep participants and staff informed with timely updates. Overall, recreation management software enhances efficiency, improves service delivery, and boosts customer satisfaction.
SOCRadar Research Team: Latest Activities of IntelBrokerSOCRadar
The European Union Agency for Law Enforcement Cooperation (Europol) has suffered an alleged data breach after a notorious threat actor claimed to have exfiltrated data from its systems. Infamous data leaker IntelBroker posted on the even more infamous BreachForums hacking forum, saying that Europol suffered a data breach this month.
The alleged breach affected Europol agencies CCSE, EC3, Europol Platform for Experts, Law Enforcement Forum, and SIRIUS. Infiltration of these entities can disrupt ongoing investigations and compromise sensitive intelligence shared among international law enforcement agencies.
However, this is neither the first nor the last activity of IntekBroker. We have compiled for you what happened in the last few days. To track such hacker activities on dark web sources like hacker forums, private Telegram channels, and other hidden platforms where cyber threats often originate, you can check SOCRadar’s Dark Web News.
Stay Informed on Threat Actors’ Activity on the Dark Web with SOCRadar!
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxrickgrimesss22
Discover the essential features to incorporate in your Winzo clone app to boost business growth, enhance user engagement, and drive revenue. Learn how to create a compelling gaming experience that stands out in the competitive market.
Cyaniclab : Software Development Agency Portfolio.pdfCyanic lab
CyanicLab, an offshore custom software development company based in Sweden,India, Finland, is your go-to partner for startup development and innovative web design solutions. Our expert team specializes in crafting cutting-edge software tailored to meet the unique needs of startups and established enterprises alike. From conceptualization to execution, we offer comprehensive services including web and mobile app development, UI/UX design, and ongoing software maintenance. Ready to elevate your business? Contact CyanicLab today and let us propel your vision to success with our top-notch IT solutions.
A Comprehensive Look at Generative AI in Retail App Testing.pdfkalichargn70th171
Traditional software testing methods are being challenged in retail, where customer expectations and technological advancements continually shape the landscape. Enter generative AI—a transformative subset of artificial intelligence technologies poised to revolutionize software testing.
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Globus
The U.S. Geological Survey (USGS) has made substantial investments in meeting evolving scientific, technical, and policy driven demands on storing, managing, and delivering data. As these demands continue to grow in complexity and scale, the USGS must continue to explore innovative solutions to improve its management, curation, sharing, delivering, and preservation approaches for large-scale research data. Supporting these needs, the USGS has partnered with the University of Chicago-Globus to research and develop advanced repository components and workflows leveraging its current investment in Globus. The primary outcome of this partnership includes the development of a prototype enterprise repository, driven by USGS Data Release requirements, through exploration and implementation of the entire suite of the Globus platform offerings, including Globus Flow, Globus Auth, Globus Transfer, and Globus Search. This presentation will provide insights into this research partnership, introduce the unique requirements and challenges being addressed and provide relevant project progress.
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...Mind IT Systems
Healthcare providers often struggle with the complexities of chronic conditions and remote patient monitoring, as each patient requires personalized care and ongoing monitoring. Off-the-shelf solutions may not meet these diverse needs, leading to inefficiencies and gaps in care. It’s here, custom healthcare software offers a tailored solution, ensuring improved care and effectiveness.
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteGoogle
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
👉👉 Click Here To Get More Info 👇👇
https://sumonreview.com/ai-pilot-review/
AI Pilot Review: Key Features
✅Deploy AI expert bots in Any Niche With Just A Click
✅With one keyword, generate complete funnels, websites, landing pages, and more.
✅More than 85 AI features are included in the AI pilot.
✅No setup or configuration; use your voice (like Siri) to do whatever you want.
✅You Can Use AI Pilot To Create your version of AI Pilot And Charge People For It…
✅ZERO Manual Work With AI Pilot. Never write, Design, Or Code Again.
✅ZERO Limits On Features Or Usages
✅Use Our AI-powered Traffic To Get Hundreds Of Customers
✅No Complicated Setup: Get Up And Running In 2 Minutes
✅99.99% Up-Time Guaranteed
✅30 Days Money-Back Guarantee
✅ZERO Upfront Cost
See My Other Reviews Article:
(1) TubeTrivia AI Review: https://sumonreview.com/tubetrivia-ai-review
(2) SocioWave Review: https://sumonreview.com/sociowave-review
(3) AI Partner & Profit Review: https://sumonreview.com/ai-partner-profit-review
(4) AI Ebook Suite Review: https://sumonreview.com/ai-ebook-suite-review
Developing Distributed High-performance Computing Capabilities of an Open Sci...Globus
COVID-19 had an unprecedented impact on scientific collaboration. The pandemic and its broad response from the scientific community has forged new relationships among public health practitioners, mathematical modelers, and scientific computing specialists, while revealing critical gaps in exploiting advanced computing systems to support urgent decision making. Informed by our team’s work in applying high-performance computing in support of public health decision makers during the COVID-19 pandemic, we present how Globus technologies are enabling the development of an open science platform for robust epidemic analysis, with the goal of collaborative, secure, distributed, on-demand, and fast time-to-solution analyses to support public health.
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdfJay Das
With the advent of artificial intelligence or AI tools, project management processes are undergoing a transformative shift. By using tools like ChatGPT, and Bard organizations can empower their leaders and managers to plan, execute, and monitor projects more effectively.
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...informapgpstrackings
Keep tabs on your field staff effortlessly with Informap Technology Centre LLC. Real-time tracking, task assignment, and smart features for efficient management. Request a live demo today!
For more details, visit us : https://informapuae.com/field-staff-tracking/
27. GenStage
• It is a new behaviour
• Exchanges data between stages
transparently with back-pressure
• Breaks into producers, consumers and
producer_consumers
34. defmodule Producer do
use GenStage
def init(counter) do
{:producer, counter}
end
def handle_demand(demand, counter) when demand > 0 do
events = Enum.to_list(counter..counter+demand-1)
{:noreply, events, counter + demand}
end
end
36. defmodule Consumer do
use GenStage
def init(:ok) do
{:consumer, :the_state_does_not_matter}
end
def handle_events(events, _from, state) do
Process.sleep(1000)
IO.inspect(events)
{:noreply, [], state}
end
end
38. Subscribeoptions
• max_demand: the maximum amount
of events to ask (default 1000)
• min_demand: when reached, ask for
more events (default 500)
39. max_demand:10,min_demand:0
1. the consumer asks for 10 items
2. the consumer receives 10 items
3. the consumer processes 10 items
4. the consumer asks for 10 more
5. the consumer waits
40. max_demand:10,min_demand:5
1. the consumer asks for 10 items
2. the consumer receives 10 items
3. the consumer processes 5 of 10 items
4. the consumer asks for 5 more
5. the consumer processes the remaining 5
62. File.stream!("source", :line)
|> Flow.from_enumerable()
|> Flow.flat_map(&String.split/1)
|> Flow.partition()
|> Flow.reduce(fn -> %{} end, fn word, map ->
Map.update(map, word, 1, & &1 + 1)
end)
|> Enum.into(%{})
• reduce/3 collects all data into maps
• when it is done, the maps are streamed
• into/2 collects the state into a map
63. Windowsandtriggers
• If reduce/3 runs until all data is processed…
what happens on unbounded data?
• See Flow.Window documentation.
68. Flowfeatures
• Provides map and reduce operations,
partitions, flow merge, flow join
• Configurable batch size (max & min demand)
• Data windowing with triggers and
watermarks
69. Distributed?
• Flow API has feature parity with
frameworks like Apache Spark
• However, there is no distribution nor
execution guarantees
70. CHEN, Y., ALSPAUGH, S., AND KATZ, R.
Interactive analytical processing in big data systems:
a cross-industry study of MapReduce workloads
“small inputs are common in practice: 40–80% of
Cloudera customers’ MapReduce jobs and 70% of
jobs in a Facebook trace have ≤ 1GB of input”
71. GOG, I., SCHWARZKOPF, M., CROOKS, N.,
GROSVENOR, M. P., CLEMENT, A., AND HAND, S.
Musketeer: all for one, one for all in data
processing systems.
“For between 40-80% of the jobs submitted
to MapReduce systems, you’d be better off
just running them on a single machine”
72. Distributed?
• Single machine matters - try it!
• The gap between concurrent and
distributed in Elixir is small
• Durability concerns will be tackled next