During my years with Rx I found it to be at the same time amazing and frustrating. Most of great RxJava presentations and blog posts try to convince you to give it a go. You really should do that, as Functional Reactive Programming will give you a new outlook on you problems. The amazement soon turns into frustration as you will be facing unfamiliar problems and you will need to find new ways to tackle them. I would like to share the most common Rx challenges that a person with less than one year of experience usually has. If your issue is not one of them, I’ll introduce some approaches how to reason about you Rx streams and figure the solution by yourself
Lesley S Fernandes has over 10 years of experience in release management and deployment roles. She currently works as a Release Manager at Barclays Technology Center India, where she leads complex monthly, quarterly, and half-yearly releases. Previously, she held roles as a Release and Deployment Manager at IBM India and roles in infrastructure administration and incident management at JP Morgan and Convergys India. She has technical skills in ITIL, PMP, and code deployment tools.
Measuring Xylem Vulnerability in Three Citrus Species (on page 31)Emily Wieber
The document summarizes evidence that volcanic deposits at Long Canyon Dome in California formed under glacial conditions. Microscopic analysis found textures in the deposits that are indicative of lava-ice interaction, including tubular vesicle shapes in pumice and dendritic fractures in sanidine crystals. Field observations also noted deposits with characteristics matching known glaciovolcanic units like sorted and graded layers. This provides evidence the eruptions occurred when the area was covered by alpine glaciers, offering insights into the paleoclimate during the Pleistocene in this region.
The document discusses the benefits of exercise for mental health. Regular physical activity can help reduce anxiety and depression and improve mood and cognitive functioning. Exercise causes chemical changes in the brain that may help boost feelings of calmness, happiness and focus.
The document describes the process of designing a concert poster in Photoshop. The designer cut out the main photo with a lasso tool, experimented with its placement on an A4 sheet, and added an abstract effect to the central photo while leaving side photos visible. Text was added in red and black fonts that stood out against the white background. Dates were placed underneath the artist's name so viewers would see them. Circles in different colors were added to the background for visual interest. Social media logos were included at the bottom to provide contact information.
This document lists various shrimp products available in different sizes, including Black Tiger Shrimp in headless sizes ranging from 8-12 to 31-40, Flower Shrimp sized 6-8, White Shrimp sized 13-15, and Vannamei Shrimp sized 31-40. It also lists Nobasi.
Lesley S Fernandes has over 10 years of experience in release management and deployment roles. She currently works as a Release Manager at Barclays Technology Center India, where she leads complex monthly, quarterly, and half-yearly releases. Previously, she held roles as a Release and Deployment Manager at IBM India and roles in infrastructure administration and incident management at JP Morgan and Convergys India. She has technical skills in ITIL, PMP, and code deployment tools.
Measuring Xylem Vulnerability in Three Citrus Species (on page 31)Emily Wieber
The document summarizes evidence that volcanic deposits at Long Canyon Dome in California formed under glacial conditions. Microscopic analysis found textures in the deposits that are indicative of lava-ice interaction, including tubular vesicle shapes in pumice and dendritic fractures in sanidine crystals. Field observations also noted deposits with characteristics matching known glaciovolcanic units like sorted and graded layers. This provides evidence the eruptions occurred when the area was covered by alpine glaciers, offering insights into the paleoclimate during the Pleistocene in this region.
The document discusses the benefits of exercise for mental health. Regular physical activity can help reduce anxiety and depression and improve mood and cognitive functioning. Exercise causes chemical changes in the brain that may help boost feelings of calmness, happiness and focus.
The document describes the process of designing a concert poster in Photoshop. The designer cut out the main photo with a lasso tool, experimented with its placement on an A4 sheet, and added an abstract effect to the central photo while leaving side photos visible. Text was added in red and black fonts that stood out against the white background. Dates were placed underneath the artist's name so viewers would see them. Circles in different colors were added to the background for visual interest. Social media logos were included at the bottom to provide contact information.
This document lists various shrimp products available in different sizes, including Black Tiger Shrimp in headless sizes ranging from 8-12 to 31-40, Flower Shrimp sized 6-8, White Shrimp sized 13-15, and Vannamei Shrimp sized 31-40. It also lists Nobasi.
The document discusses the benefits of exercise for mental health. Regular physical activity can help reduce anxiety and depression and improve mood and cognitive functioning. Exercise causes chemical changes in the brain that may help protect against mental illness and improve symptoms.
KY Consulting Group is a Georgian strategic advisory firm that offers senior counsel, insightful research, and strategic communications planning to public and private sector clients. They bring together experts to offer creative solutions and build partnerships for clients' success. The firm also helps young entrepreneurs develop skills and commercialize innovative ideas. With over 20 years of experience supporting businesses and programs, they provide strategic advisory, management services, and entrepreneurship support.
This short document promotes creating presentations using Haiku Deck, a tool for making slideshows. It encourages the reader to get started making their own Haiku Deck presentation and sharing it on SlideShare. In just one sentence, it pitches the idea of using Haiku Deck to easily design slideshows.
The document discusses the benefits of exercise for mental health. Regular physical activity can help reduce anxiety and depression and improve mood and cognitive function. Exercise causes chemical changes in the brain that may help protect against mental illness and improve symptoms for those who already suffer from conditions like anxiety and depression.
The BIG BOSS Turkey, Sagesse Consultancy tarafından özel olarak tasarlanan MT&Young Talents Training&Mentoring programıdır. Program Tayfun Bırakoğlu yönetiminde farklı sanatsal ve bilimsel disiplinlerden gelen 15 farklı uzman danışmanın katılımcıları Alman sistemiyle 360 derece geliştirmek için kurgulanmıştır. Patronları Yetiştiren Program olarak mottosunu belirleyen The Big Boss Turkey, katılımcılarına uygulamalı eğitimlerin yanı sıra bire bir mentörlük sistemiyle de gelişim sağlayacaktır.
Infrastructure Challenges in Scaling RAG with Custom AI modelsZilliz
Building Retrieval-Augmented Generation (RAG) systems with open-source and custom AI models is a complex task. This talk explores the challenges in productionizing RAG systems, including retrieval performance, response synthesis, and evaluation. We’ll discuss how to leverage open-source models like text embeddings, language models, and custom fine-tuned models to enhance RAG performance. Additionally, we’ll cover how BentoML can help orchestrate and scale these AI components efficiently, ensuring seamless deployment and management of RAG systems in the cloud.
In his public lecture, Christian Timmerer provides insights into the fascinating history of video streaming, starting from its humble beginnings before YouTube to the groundbreaking technologies that now dominate platforms like Netflix and ORF ON. Timmerer also presents provocative contributions of his own that have significantly influenced the industry. He concludes by looking at future challenges and invites the audience to join in a discussion.
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024Neo4j
Neha Bajwa, Vice President of Product Marketing, Neo4j
Join us as we explore breakthrough innovations enabled by interconnected data and AI. Discover firsthand how organizations use relationships in data to uncover contextual insights and solve our most pressing challenges – from optimizing supply chains, detecting fraud, and improving customer experiences to accelerating drug discoveries.
Sudheer Mechineni, Head of Application Frameworks, Standard Chartered Bank
Discover how Standard Chartered Bank harnessed the power of Neo4j to transform complex data access challenges into a dynamic, scalable graph database solution. This keynote will cover their journey from initial adoption to deploying a fully automated, enterprise-grade causal cluster, highlighting key strategies for modelling organisational changes and ensuring robust disaster recovery. Learn how these innovations have not only enhanced Standard Chartered Bank’s data infrastructure but also positioned them as pioneers in the banking sector’s adoption of graph technology.
Maruthi Prithivirajan, Head of ASEAN & IN Solution Architecture, Neo4j
Get an inside look at the latest Neo4j innovations that enable relationship-driven intelligence at scale. Learn more about the newest cloud integrations and product enhancements that make Neo4j an essential choice for developers building apps with interconnected data and generative AI.
Pushing the limits of ePRTC: 100ns holdover for 100 daysAdtran
At WSTS 2024, Alon Stern explored the topic of parametric holdover and explained how recent research findings can be implemented in real-world PNT networks to achieve 100 nanoseconds of accuracy for up to 100 days.
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceIndexBug
Imagine a world where machines not only perform tasks but also learn, adapt, and make decisions. This is the promise of Artificial Intelligence (AI), a technology that's not just enhancing our lives but revolutionizing entire industries.
Building Production Ready Search Pipelines with Spark and MilvusZilliz
Spark is the widely used ETL tool for processing, indexing and ingesting data to serving stack for search. Milvus is the production-ready open-source vector database. In this talk we will show how to use Spark to process unstructured data to extract vector representations, and push the vectors to Milvus vector database for search serving.
UiPath Test Automation using UiPath Test Suite series, part 5DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 5. In this session, we will cover CI/CD with devops.
Topics covered:
CI/CD with in UiPath
End-to-end overview of CI/CD pipeline with Azure devops
Speaker:
Lyndsey Byblow, Test Suite Sales Engineer @ UiPath, Inc.
Threats to mobile devices are more prevalent and increasing in scope and complexity. Users of mobile devices desire to take full advantage of the features
available on those devices, but many of the features provide convenience and capability but sacrifice security. This best practices guide outlines steps the users can take to better protect personal devices and information.
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!SOFTTECHHUB
As the digital landscape continually evolves, operating systems play a critical role in shaping user experiences and productivity. The launch of Nitrux Linux 3.5.0 marks a significant milestone, offering a robust alternative to traditional systems such as Windows 11. This article delves into the essence of Nitrux Linux 3.5.0, exploring its unique features, advantages, and how it stands as a compelling choice for both casual users and tech enthusiasts.
Essentials of Automations: The Art of Triggers and Actions in FMESafe Software
In this second installment of our Essentials of Automations webinar series, we’ll explore the landscape of triggers and actions, guiding you through the nuances of authoring and adapting workspaces for seamless automations. Gain an understanding of the full spectrum of triggers and actions available in FME, empowering you to enhance your workspaces for efficient automation.
We’ll kick things off by showcasing the most commonly used event-based triggers, introducing you to various automation workflows like manual triggers, schedules, directory watchers, and more. Plus, see how these elements play out in real scenarios.
Whether you’re tweaking your current setup or building from the ground up, this session will arm you with the tools and insights needed to transform your FME usage into a powerhouse of productivity. Join us to discover effective strategies that simplify complex processes, enhancing your productivity and transforming your data management practices with FME. Let’s turn complexity into clarity and make your workspaces work wonders!
The document discusses the benefits of exercise for mental health. Regular physical activity can help reduce anxiety and depression and improve mood and cognitive functioning. Exercise causes chemical changes in the brain that may help protect against mental illness and improve symptoms.
KY Consulting Group is a Georgian strategic advisory firm that offers senior counsel, insightful research, and strategic communications planning to public and private sector clients. They bring together experts to offer creative solutions and build partnerships for clients' success. The firm also helps young entrepreneurs develop skills and commercialize innovative ideas. With over 20 years of experience supporting businesses and programs, they provide strategic advisory, management services, and entrepreneurship support.
This short document promotes creating presentations using Haiku Deck, a tool for making slideshows. It encourages the reader to get started making their own Haiku Deck presentation and sharing it on SlideShare. In just one sentence, it pitches the idea of using Haiku Deck to easily design slideshows.
The document discusses the benefits of exercise for mental health. Regular physical activity can help reduce anxiety and depression and improve mood and cognitive function. Exercise causes chemical changes in the brain that may help protect against mental illness and improve symptoms for those who already suffer from conditions like anxiety and depression.
The BIG BOSS Turkey, Sagesse Consultancy tarafından özel olarak tasarlanan MT&Young Talents Training&Mentoring programıdır. Program Tayfun Bırakoğlu yönetiminde farklı sanatsal ve bilimsel disiplinlerden gelen 15 farklı uzman danışmanın katılımcıları Alman sistemiyle 360 derece geliştirmek için kurgulanmıştır. Patronları Yetiştiren Program olarak mottosunu belirleyen The Big Boss Turkey, katılımcılarına uygulamalı eğitimlerin yanı sıra bire bir mentörlük sistemiyle de gelişim sağlayacaktır.
Infrastructure Challenges in Scaling RAG with Custom AI modelsZilliz
Building Retrieval-Augmented Generation (RAG) systems with open-source and custom AI models is a complex task. This talk explores the challenges in productionizing RAG systems, including retrieval performance, response synthesis, and evaluation. We’ll discuss how to leverage open-source models like text embeddings, language models, and custom fine-tuned models to enhance RAG performance. Additionally, we’ll cover how BentoML can help orchestrate and scale these AI components efficiently, ensuring seamless deployment and management of RAG systems in the cloud.
In his public lecture, Christian Timmerer provides insights into the fascinating history of video streaming, starting from its humble beginnings before YouTube to the groundbreaking technologies that now dominate platforms like Netflix and ORF ON. Timmerer also presents provocative contributions of his own that have significantly influenced the industry. He concludes by looking at future challenges and invites the audience to join in a discussion.
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024Neo4j
Neha Bajwa, Vice President of Product Marketing, Neo4j
Join us as we explore breakthrough innovations enabled by interconnected data and AI. Discover firsthand how organizations use relationships in data to uncover contextual insights and solve our most pressing challenges – from optimizing supply chains, detecting fraud, and improving customer experiences to accelerating drug discoveries.
Sudheer Mechineni, Head of Application Frameworks, Standard Chartered Bank
Discover how Standard Chartered Bank harnessed the power of Neo4j to transform complex data access challenges into a dynamic, scalable graph database solution. This keynote will cover their journey from initial adoption to deploying a fully automated, enterprise-grade causal cluster, highlighting key strategies for modelling organisational changes and ensuring robust disaster recovery. Learn how these innovations have not only enhanced Standard Chartered Bank’s data infrastructure but also positioned them as pioneers in the banking sector’s adoption of graph technology.
Maruthi Prithivirajan, Head of ASEAN & IN Solution Architecture, Neo4j
Get an inside look at the latest Neo4j innovations that enable relationship-driven intelligence at scale. Learn more about the newest cloud integrations and product enhancements that make Neo4j an essential choice for developers building apps with interconnected data and generative AI.
Pushing the limits of ePRTC: 100ns holdover for 100 daysAdtran
At WSTS 2024, Alon Stern explored the topic of parametric holdover and explained how recent research findings can be implemented in real-world PNT networks to achieve 100 nanoseconds of accuracy for up to 100 days.
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceIndexBug
Imagine a world where machines not only perform tasks but also learn, adapt, and make decisions. This is the promise of Artificial Intelligence (AI), a technology that's not just enhancing our lives but revolutionizing entire industries.
Building Production Ready Search Pipelines with Spark and MilvusZilliz
Spark is the widely used ETL tool for processing, indexing and ingesting data to serving stack for search. Milvus is the production-ready open-source vector database. In this talk we will show how to use Spark to process unstructured data to extract vector representations, and push the vectors to Milvus vector database for search serving.
UiPath Test Automation using UiPath Test Suite series, part 5DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 5. In this session, we will cover CI/CD with devops.
Topics covered:
CI/CD with in UiPath
End-to-end overview of CI/CD pipeline with Azure devops
Speaker:
Lyndsey Byblow, Test Suite Sales Engineer @ UiPath, Inc.
Threats to mobile devices are more prevalent and increasing in scope and complexity. Users of mobile devices desire to take full advantage of the features
available on those devices, but many of the features provide convenience and capability but sacrifice security. This best practices guide outlines steps the users can take to better protect personal devices and information.
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!SOFTTECHHUB
As the digital landscape continually evolves, operating systems play a critical role in shaping user experiences and productivity. The launch of Nitrux Linux 3.5.0 marks a significant milestone, offering a robust alternative to traditional systems such as Windows 11. This article delves into the essence of Nitrux Linux 3.5.0, exploring its unique features, advantages, and how it stands as a compelling choice for both casual users and tech enthusiasts.
Essentials of Automations: The Art of Triggers and Actions in FMESafe Software
In this second installment of our Essentials of Automations webinar series, we’ll explore the landscape of triggers and actions, guiding you through the nuances of authoring and adapting workspaces for seamless automations. Gain an understanding of the full spectrum of triggers and actions available in FME, empowering you to enhance your workspaces for efficient automation.
We’ll kick things off by showcasing the most commonly used event-based triggers, introducing you to various automation workflows like manual triggers, schedules, directory watchers, and more. Plus, see how these elements play out in real scenarios.
Whether you’re tweaking your current setup or building from the ground up, this session will arm you with the tools and insights needed to transform your FME usage into a powerhouse of productivity. Join us to discover effective strategies that simplify complex processes, enhancing your productivity and transforming your data management practices with FME. Let’s turn complexity into clarity and make your workspaces work wonders!
For the full video of this presentation, please visit: https://www.edge-ai-vision.com/2024/06/building-and-scaling-ai-applications-with-the-nx-ai-manager-a-presentation-from-network-optix/
Robin van Emden, Senior Director of Data Science at Network Optix, presents the “Building and Scaling AI Applications with the Nx AI Manager,” tutorial at the May 2024 Embedded Vision Summit.
In this presentation, van Emden covers the basics of scaling edge AI solutions using the Nx tool kit. He emphasizes the process of developing AI models and deploying them globally. He also showcases the conversion of AI models and the creation of effective edge AI pipelines, with a focus on pre-processing, model conversion, selecting the appropriate inference engine for the target hardware and post-processing.
van Emden shows how Nx can simplify the developer’s life and facilitate a rapid transition from concept to production-ready applications.He provides valuable insights into developing scalable and efficient edge AI solutions, with a strong focus on practical implementation.
Full-RAG: A modern architecture for hyper-personalizationZilliz
Mike Del Balso, CEO & Co-Founder at Tecton, presents "Full RAG," a novel approach to AI recommendation systems, aiming to push beyond the limitations of traditional models through a deep integration of contextual insights and real-time data, leveraging the Retrieval-Augmented Generation architecture. This talk will outline Full RAG's potential to significantly enhance personalization, address engineering challenges such as data management and model training, and introduce data enrichment with reranking as a key solution. Attendees will gain crucial insights into the importance of hyperpersonalization in AI, the capabilities of Full RAG for advanced personalization, and strategies for managing complex data integrations for deploying cutting-edge AI solutions.
Driving Business Innovation: Latest Generative AI Advancements & Success StorySafe Software
Are you ready to revolutionize how you handle data? Join us for a webinar where we’ll bring you up to speed with the latest advancements in Generative AI technology and discover how leveraging FME with tools from giants like Google Gemini, Amazon, and Microsoft OpenAI can supercharge your workflow efficiency.
During the hour, we’ll take you through:
Guest Speaker Segment with Hannah Barrington: Dive into the world of dynamic real estate marketing with Hannah, the Marketing Manager at Workspace Group. Hear firsthand how their team generates engaging descriptions for thousands of office units by integrating diverse data sources—from PDF floorplans to web pages—using FME transformers, like OpenAIVisionConnector and AnthropicVisionConnector. This use case will show you how GenAI can streamline content creation for marketing across the board.
Ollama Use Case: Learn how Scenario Specialist Dmitri Bagh has utilized Ollama within FME to input data, create custom models, and enhance security protocols. This segment will include demos to illustrate the full capabilities of FME in AI-driven processes.
Custom AI Models: Discover how to leverage FME to build personalized AI models using your data. Whether it’s populating a model with local data for added security or integrating public AI tools, find out how FME facilitates a versatile and secure approach to AI.
We’ll wrap up with a live Q&A session where you can engage with our experts on your specific use cases, and learn more about optimizing your data workflows with AI.
This webinar is ideal for professionals seeking to harness the power of AI within their data management systems while ensuring high levels of customization and security. Whether you're a novice or an expert, gain actionable insights and strategies to elevate your data processes. Join us to see how FME and AI can revolutionize how you work with data!
“An Outlook of the Ongoing and Future Relationship between Blockchain Technologies and Process-aware Information Systems.” Invited talk at the joint workshop on Blockchain for Information Systems (BC4IS) and Blockchain for Trusted Data Sharing (B4TDS), co-located with with the 36th International Conference on Advanced Information Systems Engineering (CAiSE), 3 June 2024, Limassol, Cyprus.
Today I would like to talk about frustrations.
We developers have those on daily basis,
The API doesn’t work properly, somebody’s horrible code ended up in the repo, or just the application has some mysterious issues.
We have then the need to talk about those frustration. Sometimes we talk to other developers, sometimes we talk to rubber animals.
But this practice is not meaningless, either we figure out a solution to our problem or we prevent others from repeating ours mistakes.
So what does Rx have to do with it.
In recent year there we loads or articles and talks saying how great Rx is, but is not always rainbows and unicorns, it has some bad sides as well.
Today I won’t focus on the Unicorns, but rather I would like to talk about some frustrating things about Rx.
Still the frustrations are not always the same.
As you discover Rx, things that annoy you, change.
What I’ve experienced, there are three stages of using Rx
But before I continue with the stages, could I ask you some questions?
- people who read anything about Rx
- people who wrote any code in Rx
- who have written any production code in Rx
- who have 1+ years of experience in Rx
I remember the first day I've been introduced to Rx. A colleague mine, Olli, was playing with something called Reactive Extensions on his free time.
He wanted to show us an example of auto-suggestion field.
Autosuggestion field is not the most interesting thing in a world, but most of the Olli know what he was talking about, so we joined the presentation.
I’ve expected the talk to be about an hour, and at the end we would have an overview how we should write autosuggestion field.
The talk turned into a 15-minute presentation with a working code at the end.
I’ve started to use Rx in my projects. It was amazing.
As our project grew bigger - it started to behave in a more unpredictable way.
Started to crash randomly, backpressure exceptions were occurring, it wasn't performing so well even though I thought I've put everything on background threads, or so we thought.
The biggest issue was that I was not able to reason about the code. By reasoning about code, I mean just by looking at a block of code you exactly know how it will behave.
Sometimes I even missed the good old, not reactive days.
Developers know that when using library/framework/tool you not only need to know it's API, or interface. You need to know how it works under the hood.
That’s what we did.
So we’ve learned how Rx works.
Next we’ve removed side-effects from observables, kept them clean, we’ve remembered to schedule tasks properly on background threads. We’ve made the application maintainable again.
Not only that, adding new features started to be easier and faster. Code became more and more testable.
All of this mainly because because we were able to write code that we could reason about.
Still, there are moments when the code does not work like intended but most of the time they are either easy ways to solve or investigate it.
So let’s go frustrations that we’ve encountered.
We all know and love anonymous classes in java.
This sentence is only half true.
If you are writing normal java code, this is not such a big frustration.
But in Rx you will need loads of those. And if you choose to still use them, it will be frustrating.
Instead use lambdas.
Doesn’t matter if you will be using retrolambda, jack or kotlin.
Just pick one and enjoy!
Sometimes when I write a really complex Observable, such as this one.
When I am finished, I run the app or test to verify that it works – but nothing happens.
Added logging in multiple places, changing schedulers – still noting.
Then a single thought comes – where did I subscribed?
Always subscribe!
Why
Again we have a complicated Observable.
We combine here two last values from first and second, and then print the result.
But again it does not print.
First we check that we subscribed, from now on in every example lets assume we subscribed.
So when I used to have this problem with combine latest – I didn’t know just by reading the code, how will the observable behave.
I had to fallow creation path of those obs and check if they ever emit a value.
I was not able to get it from this code.
Similar thing goes with concat – which subsribes to first stream, emits its values and until complete event comes
Then subscribes to the next one.
But for some reason the events from the second one are never emitted.
Again, we don’t know the reason just by looking at this code.
Being forced to go up the stream of observables everythime you want to understand the issue, is really frustrating.
There are two ways to handle this issue – with types or with naming.
We went with nameing
Let me tell you the approach we use in our project.
getValue() - this is a normal way how you would expose an Observable. Same problem as before - we do not know how it will behave
getValueOnce() - First of ours naming convention - this Observable will emit value as quickly as possible after subscription
getValueStream() - this Observable can emit infinite amount of events. It does not give us guaranty that it will emit anything after subscription. The only thing it can guarantee us is that it will never complete - example mouse click events
getValueOnceAndStream - will emit event as soon as possible after subscription and will continue on emitting events indefinitely. Example, checking if device is online/has internet access and then listening if the network status has changed.
So let see how does it work with combineLatest.
Now we see that the first observable will trigger only once and then complete.
The second one will trigger and then continue with emitting events if any.
Only by looking at it, we know that the combineLatest will emit at least one value.
If the second Observable emits new items - it will combine them with the only value of the first Observable.
With this approach, it is much easier to reason about your observables. You don't need to follow the creation path of the observable to know it will behave.
Now I would like to talk about one of the most confusing and at the same time the most crucial operators in RxJava.
There are a couple of operators that have this exact signature.
As a parameter, they accept function with one argument T and result of Observable<R>, which is at the same time this is the same thing the entire thing returns.
Can anyone make a wild guess?
This signature is shared between 3 operators – flatMap, switchMap, and concatMap
“Story about not knowing flatMap”
“Explain announcer example”
I cannot stress enough how important is to know the difference. If you are doing a Rx app and this difference is not clear yet, spend some time on playing around with them.
It will save you plenty of problems!
Next thing, how you should subscribe.
You could subscribe in this way, when you do not care about errors or if the observable completes.
But you shouldn't do it like that.
The reason is that if for some reason the getCountStream emits an error, not implemented error will be thrown, and that might crash your application.
Instead always implement the handler for the error case, even if you would just log the error.
One of the selling points or Rx is that you can schedule your work with ease on any thread you’d like.
Still, you need to think about it most of the time when you write the code.
One common issue that I see is how people start Observables with heavy, blocking functions.
Just is a really handy operator that starts Observable stream with a value.
But people forget that it still accepts a value.
If you call the method like that, it will be executed on the same thread on which entire Observable was created, and NOT subscribed.
In those cases, you need to have a more lazy approach.
FromCallable is a really useful operator that will call the passed function on subscription – so it will adhere to the subscribeOn operator.
When you create an Observable that has a costly subscription, for example, Retrofit observables, you need to watch out how often you subscribe to it.
In this example, for every subscribe, we would run the expensive function one more time.
It's ok to do it if this is exactly what you want.
But if you want to reuse the outcome of the expensive function, you either can cache it or share it.
One super power Rx has is the ease of switching threads
The key here is subscribeOn and observeOn.
Similarly to what I said about maps, you have to know the difference between them.
// Explain
SubscribeOn does not work with Subjects - if you didn't know that, your team is not the first one wondering why there is so much stuff happening on UI thread.
Retrofit – explain and say about heavy lifting
Zip is an interesting operator.
It is a good way to show to new people the power of combining observables.
But in real life tasks, it could create more issues than it's worth.
First of all, it can make your code hard to read and maintain. Most of the cases when people say that Rx code is hard to manage, they mention zip.
Additionally, backpressure problems are quite frequent when using zip.
I am not saying you should not use zip, just know how it works, and what are it's strengths and weaknesses.
And in most of the cases, zip can be replaces by one of the map operators.
Debounce operator was the first one I've seen.
It was used for the autosuggestion example that I've told you about.
But it is also one of the most misused operators.
// Explain
Whenever someone has an Observable that for some reason triggers too often, that person could use it to filter too much noise.
But debounce introduces time-based side-effects that are hard to investigate.
Also, it could unnecessarily slow down your application due to the debounce time window.
It is always better to investigate why that other Observable triggers too often and fix the underlying cause.
You should always subscribe if you want Observable to trigger, I hope that's clear now.
But every time you subscribe, you create a subscription.
If you don't unsubscribe that subscription, you might create a memory leak.
There are cases when the subscription will be managed by itself, but it is always safer to do it by yourself.
But your problem might not be one of those.
The gut feeling will not always lead you to a solution of your problem.
In those cases, you need to start debugging.
Most common way to debug Observables is to use doOnNext. It will nicely tell you when events are happening.
But in some cases it is not enough, the reason why the observable is not triggering might be that it emitted an error or it completed.
I would strongly suggest to use doOnEach instead. That way you will be able to see all the events that might happen on the Observable.
And if that is still not enough, use doOnSubscribe and doOnUnsubscribe to check it the problem was with subscribing or unsubscribing.
Once someone asked me if I could sum up the benefits of Rx in 10 words? I've come up with an ok solution.
But that question got stuck in my head. After a while came up with shorter and better answer.
If you want your application to be really reactive, you can write the code without using Rx.
But the code complexity easily can get to a stage that it will be unmaintainable.
Rx is made to control the complexity and keep it in place.
After 3 years with Rx, I am cautiously optimistic about writing reactive code. I know that it is a really nice tool, but still only a tool.
Sometimes it's really useful, sometimes is only brings confusion.
Knowing when to use it and when it will only make your work more difficult is the most important skill you can acquire in Rx.