The document describes the key abstractions in Akka Streams - Source, Sink, and Flow. It provides examples of creating Sources from single values, iterators, and ticks. It also gives examples of Sinks like foreach, head, fold, and reduce. Various Flow operations are demonstrated like map, filter, take, drop, and flatMapConcat. The document then gives an example problem of reading log files from HDFS in parallel to find 100 fraudulent transactions using Akka Streams.
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.
This document discusses various optimizations and improvements made to Java streams in recent versions. It provides examples of counting large streams, converting streams to arrays, collecting to lists, sorting, skipping elements, and using streams in parallel pipelines. It also covers characteristics of streams like SIZED, ORDERED, DISTINCT, and how operations like distinct(), skip(), and concat() perform in parallel scenarios. Overall it analyzes the performance of core stream operations and how their implementations have evolved.
Scalaz By Example (An IO Taster) -- PDXScala Meetup Jan 2014Susan Potter
This document discusses patterns in object-oriented programming versus abstractions in functional programming. It provides code examples of using functional abstractions like the IO monad and type classes in Scala. The examples demonstrate how to construct programs by composing functions, handle errors, and test programs using the IO monad. Known applications of functional abstractions include using monoids for accumulating values, functors for mapping over data types, and monads for modeling effects. The document advocates thinking algebraically by focusing on properties, extending closed data types, and building applications from small, composable abstractions.
The Ring programming language version 1.5.3 book - Part 88 of 184Mahmoud Samir Fayed
This document describes various functions in the Ring programming language that provide debugging and tracing capabilities. It discusses functions like ringvm_memorylist(), ringvm_calllist(), ringvm_fileslist() which provide information about memory, function calls and loaded files. It also covers functions like ringvm_settrace(), ringvm_tracedata(), ringvm_traceevent() that allow setting a trace function and getting trace data within that function to trace program execution. An example at the end demonstrates using these functions to implement a trace library for Ring.
Tips and Tricks of Developing .NET ApplicationJoni
This document provides tips and best practices for developing .NET applications. It covers general best practices such as optimization of loops, proper object disposal, and avoiding unnecessary object instantiation. It also includes ASP.NET specific tips like disabling viewstate if not used and avoiding unnecessary round trips to the server. Windows Forms tips involve using multithreading properly and marshaling method calls to the correct thread. The document recommends using existing libraries and not reinventing functionality unnecessarily.
The Ring programming language version 1.5.3 book - Part 44 of 184Mahmoud Samir Fayed
This document provides code examples for classes used in a web application framework in Ring. It includes the Database, ModelBase, and ControllerBase classes which handle database connectivity and operations. It also includes an overview of the WebLib API which provides functions and classes for generating HTML pages and elements. Some key classes described are Page, Form, Table, and classes to generate specific HTML elements like Div, Link, Image etc.
The Ring programming language version 1.5.4 book - Part 10 of 185Mahmoud Samir Fayed
This document summarizes the key features and changes in Ring 1.5.2, including updates to the documentation, Ring Notepad, Form Designer, and sample applications. It provides code examples demonstrating new capabilities in the trace library, type hints library, OpenGL graphics, and event handling.
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.
This document discusses various optimizations and improvements made to Java streams in recent versions. It provides examples of counting large streams, converting streams to arrays, collecting to lists, sorting, skipping elements, and using streams in parallel pipelines. It also covers characteristics of streams like SIZED, ORDERED, DISTINCT, and how operations like distinct(), skip(), and concat() perform in parallel scenarios. Overall it analyzes the performance of core stream operations and how their implementations have evolved.
Scalaz By Example (An IO Taster) -- PDXScala Meetup Jan 2014Susan Potter
This document discusses patterns in object-oriented programming versus abstractions in functional programming. It provides code examples of using functional abstractions like the IO monad and type classes in Scala. The examples demonstrate how to construct programs by composing functions, handle errors, and test programs using the IO monad. Known applications of functional abstractions include using monoids for accumulating values, functors for mapping over data types, and monads for modeling effects. The document advocates thinking algebraically by focusing on properties, extending closed data types, and building applications from small, composable abstractions.
The Ring programming language version 1.5.3 book - Part 88 of 184Mahmoud Samir Fayed
This document describes various functions in the Ring programming language that provide debugging and tracing capabilities. It discusses functions like ringvm_memorylist(), ringvm_calllist(), ringvm_fileslist() which provide information about memory, function calls and loaded files. It also covers functions like ringvm_settrace(), ringvm_tracedata(), ringvm_traceevent() that allow setting a trace function and getting trace data within that function to trace program execution. An example at the end demonstrates using these functions to implement a trace library for Ring.
Tips and Tricks of Developing .NET ApplicationJoni
This document provides tips and best practices for developing .NET applications. It covers general best practices such as optimization of loops, proper object disposal, and avoiding unnecessary object instantiation. It also includes ASP.NET specific tips like disabling viewstate if not used and avoiding unnecessary round trips to the server. Windows Forms tips involve using multithreading properly and marshaling method calls to the correct thread. The document recommends using existing libraries and not reinventing functionality unnecessarily.
The Ring programming language version 1.5.3 book - Part 44 of 184Mahmoud Samir Fayed
This document provides code examples for classes used in a web application framework in Ring. It includes the Database, ModelBase, and ControllerBase classes which handle database connectivity and operations. It also includes an overview of the WebLib API which provides functions and classes for generating HTML pages and elements. Some key classes described are Page, Form, Table, and classes to generate specific HTML elements like Div, Link, Image etc.
The Ring programming language version 1.5.4 book - Part 10 of 185Mahmoud Samir Fayed
This document summarizes the key features and changes in Ring 1.5.2, including updates to the documentation, Ring Notepad, Form Designer, and sample applications. It provides code examples demonstrating new capabilities in the trace library, type hints library, OpenGL graphics, and event handling.
The Ring programming language version 1.5.3 book - Part 10 of 184Mahmoud Samir Fayed
This document summarizes the key features and changes in Ring 1.5.3, including:
- The trace library allows tracing function calls and opening an interactive debugger. An example uses a breakpoint.
- The type hints library allows adding type information to improve code editors and static analysis. It supports user-defined types.
- Overall the documentation and quality of Ring 1.5 has improved based on real-world usage.
The Ring programming language version 1.10 book - Part 94 of 212Mahmoud Samir Fayed
The document describes the Trace Library in Ring and how it can be used to trace program execution, debug code, and step through a program line by line. It provides examples of loading the Trace Library, tracing all events, tracing control flow between functions, and using the pass error functionality to continue execution after an error. Key functions and capabilities of the Trace Library discussed include tracing specific events, setting breakpoints, accessing trace data, and redefining see and give behavior.
This document summarizes Benjamin Eberlei's talk on using Doctrine to interact with databases in PHP applications. Doctrine provides an object relational mapper (ORM) and database abstraction layer (DBAL) that allow developers to work with various database systems in a consistent way. The DBAL component handles driver abstraction, SQL dialects, convenience APIs, SQL types and database schema handling to simplify common database tasks.
Xlab #1: Advantages of functional programming in Java 8XSolve
Presentation from xlab workshop about functional programming components introduced to the Java 8. How to operate the streams and lambdas in theory and practice.
An introduction to functional programming with goEleanor McHugh
A crash course in functional programming concepts using Go. Heavy on code, light on theory.
You can find the examples at https://github.com/feyeleanor/intro_to_fp_in_go
The document discusses functional programming techniques for refactoring an imperative program that calculates the sum of squares of even numbers up to a given maximum. It shows how to decompose the program into pure, testable functions using recursion and higher-order functions. This makes the program more reusable, composable and easier to test compared to the original mutable, statement-based implementation.
Implementing virtual machines in go & c 2018 reduxEleanor McHugh
An updated version of my talk on virtual machine cores comparing techniques in C and Go for implementing dispatch loops, stacks & hash maps.
Lots of tested and debugged code is provided as well as references to some useful/interesting books.
This document discusses Jscex, which allows writing asynchronous JavaScript code in a synchronous style using the $await operator. It provides examples of rewriting bubble sort to use asynchronous compare and swap functions. It also discusses using Jscex to handle parallelism, I/O, and concurrency in applications. Key benefits mentioned include just-in-time compilation for performance and ahead-of-time compilation for smaller file sizes.
Mcs011 solved assignment by divya singhDIVYA SINGH
The document contains code snippets and questions related to C programming. It includes programs to:
1. Convert between octal and decimal numbers, withdraw money from an ATM, find the largest element in an array using recursion, separate even and odd numbers in an array into two arrays.
2. Determine if a matrix is sparse, calculate the sum of array elements using pointers, append the contents of one file to another file.
3. Create and update student records in a file by sorting, adding, searching, editing, and deleting records.
This document discusses environments and scoping in R. It provides examples of how parent environments and parent frames work when calling functions. The key points are:
- The parent environment of a function is the environment in which the function is defined.
- The parent frame of a function is the environment from which the function was called.
- Variables in the parent environments and frames may be accessible depending on the context.
The document discusses networking concepts like client-server communication and provides code examples of an echo server and client. It explains how a client and server can communicate by creating sockets to connect to each other on a specified port, then reading from and writing to each other's input and output streams. The document also provides an example of a multi-threaded echo server that handles multiple clients concurrently by creating a new thread for each client. Finally, it discusses a quote server that uses UDP to send a random quote to clients in response to receiving an empty datagram packet from them.
PHP data structures (and the impact of php 7 on them), phpDay Verona 2015, ItalyPatrick Allaert
We all have certainly learned data structures at school: arrays, lists, sets, stacks, queues (LIFO/FIFO), heaps, associative arrays, trees, ... and what do we mostly use in PHP? The "array"! In most cases, we do everything and anything with it but we stumble upon it when profiling code. During this session, we'll learn again to use the structures appropriately, leaning closer on the way to employ arrays, the SPL and other structures from PHP extensions as well.The impact that PHP 7 should have on data structures will be introduced as well.
This document discusses Java collections frameworks. It covers core collection interfaces like List, Set, Queue and Map. It also discusses concrete collection classes that implement these interfaces like ArrayList, LinkedList, HashSet, TreeSet, HashMap and TreeMap. The document further explains concepts like iterators, generics in collections and differences between collections before and after generics.
This document provides tips and tricks for installing Kotlin programming tools and covers fundamental Kotlin concepts like data types, variables, functions, control flow structures, and loops. It discusses installing Kotlin and resolving common errors. It introduces basic Kotlin syntax for strings, numbers, Booleans, arrays, and more. It also covers if/else expressions, when expressions, enums, loops like while, for, and for-each, and break/continue functionality. The document encourages practicing exercises to continue learning Kotlin.
Functional Patterns for the non-mathematicianBrian Lonsdorf
Fluentconf 2014 talk:
Functional design patterns such as lenses, arrows, functors, and monads all come from category theory. To fully grok them, you’ll probably have to wade through the whitest white papers, fighting the mathematical syntax and abstract examples.
I’m hoping to demonstrate the ideas into javascript. I’ll be showing direct and practical applications for every day programming.
The Ring programming language version 1.8 book - Part 75 of 202Mahmoud Samir Fayed
This document describes the code for a basic notepad application created using the Ring programming language. It defines functions for opening, saving, and editing text files. The application features a menu bar, toolbars, dockable panels for a file tree and text editor, and basic text editing functionality like font selection, find/replace, and print.
The Ring programming language version 1.10 book - Part 54 of 212Mahmoud Samir Fayed
This document describes code related to user registration and login functionality in Ring. It includes code for a registration form, login form, user registration logic, login validation, and checking if a user is logged in. Database and model classes are also shown that handle connecting to the database, querying for users, and managing user data.
This document discusses Java 8 streams and provides examples of:
- Creating streams from collections, arrays, and iterators
- Common intermediate stream operations like filter, map, and distinct
- Terminal stream operations like forEach, collect, and reduce
- Features of streams like laziness and lack of storage
- Parallel stream processing and ensuring non-interference with source data
- Best practices for stateless parallel stream operations
This document discusses refactoring Java code to Clojure using macros. It provides examples of refactoring Java code that uses method chaining to equivalent Clojure code using the threading macros (->> and -<>). It also discusses other Clojure features like type hints, the doto macro, and polyglot projects using Leiningen.
Kotlin Coroutines Flow is coming to provide a cold asynchronous data stream that emits values sequentially within a coroutine. Flow allows mapping, filtering, and collecting values, handles exceptions transparently, and preserves context. It can integrate with existing APIs like Room and Retrofit using adapters, and is the primary way to handle async streams going forward. Channels will still be used for hot streams and synchronization between coroutines.
This document provides an introduction to Akka.NET Streams and Reactive Streams. It discusses key concepts like observables, async enumerables, and reactive streams. It also demonstrates how to build workflows with Akka.NET streams, including examples of building a TCP server. The document introduces core Akka.NET streams concepts like sources, flows, and sinks, and how they compose together in a runnable graph. It also covers testing streams with probes and materialization.
The Ring programming language version 1.5.3 book - Part 10 of 184Mahmoud Samir Fayed
This document summarizes the key features and changes in Ring 1.5.3, including:
- The trace library allows tracing function calls and opening an interactive debugger. An example uses a breakpoint.
- The type hints library allows adding type information to improve code editors and static analysis. It supports user-defined types.
- Overall the documentation and quality of Ring 1.5 has improved based on real-world usage.
The Ring programming language version 1.10 book - Part 94 of 212Mahmoud Samir Fayed
The document describes the Trace Library in Ring and how it can be used to trace program execution, debug code, and step through a program line by line. It provides examples of loading the Trace Library, tracing all events, tracing control flow between functions, and using the pass error functionality to continue execution after an error. Key functions and capabilities of the Trace Library discussed include tracing specific events, setting breakpoints, accessing trace data, and redefining see and give behavior.
This document summarizes Benjamin Eberlei's talk on using Doctrine to interact with databases in PHP applications. Doctrine provides an object relational mapper (ORM) and database abstraction layer (DBAL) that allow developers to work with various database systems in a consistent way. The DBAL component handles driver abstraction, SQL dialects, convenience APIs, SQL types and database schema handling to simplify common database tasks.
Xlab #1: Advantages of functional programming in Java 8XSolve
Presentation from xlab workshop about functional programming components introduced to the Java 8. How to operate the streams and lambdas in theory and practice.
An introduction to functional programming with goEleanor McHugh
A crash course in functional programming concepts using Go. Heavy on code, light on theory.
You can find the examples at https://github.com/feyeleanor/intro_to_fp_in_go
The document discusses functional programming techniques for refactoring an imperative program that calculates the sum of squares of even numbers up to a given maximum. It shows how to decompose the program into pure, testable functions using recursion and higher-order functions. This makes the program more reusable, composable and easier to test compared to the original mutable, statement-based implementation.
Implementing virtual machines in go & c 2018 reduxEleanor McHugh
An updated version of my talk on virtual machine cores comparing techniques in C and Go for implementing dispatch loops, stacks & hash maps.
Lots of tested and debugged code is provided as well as references to some useful/interesting books.
This document discusses Jscex, which allows writing asynchronous JavaScript code in a synchronous style using the $await operator. It provides examples of rewriting bubble sort to use asynchronous compare and swap functions. It also discusses using Jscex to handle parallelism, I/O, and concurrency in applications. Key benefits mentioned include just-in-time compilation for performance and ahead-of-time compilation for smaller file sizes.
Mcs011 solved assignment by divya singhDIVYA SINGH
The document contains code snippets and questions related to C programming. It includes programs to:
1. Convert between octal and decimal numbers, withdraw money from an ATM, find the largest element in an array using recursion, separate even and odd numbers in an array into two arrays.
2. Determine if a matrix is sparse, calculate the sum of array elements using pointers, append the contents of one file to another file.
3. Create and update student records in a file by sorting, adding, searching, editing, and deleting records.
This document discusses environments and scoping in R. It provides examples of how parent environments and parent frames work when calling functions. The key points are:
- The parent environment of a function is the environment in which the function is defined.
- The parent frame of a function is the environment from which the function was called.
- Variables in the parent environments and frames may be accessible depending on the context.
The document discusses networking concepts like client-server communication and provides code examples of an echo server and client. It explains how a client and server can communicate by creating sockets to connect to each other on a specified port, then reading from and writing to each other's input and output streams. The document also provides an example of a multi-threaded echo server that handles multiple clients concurrently by creating a new thread for each client. Finally, it discusses a quote server that uses UDP to send a random quote to clients in response to receiving an empty datagram packet from them.
PHP data structures (and the impact of php 7 on them), phpDay Verona 2015, ItalyPatrick Allaert
We all have certainly learned data structures at school: arrays, lists, sets, stacks, queues (LIFO/FIFO), heaps, associative arrays, trees, ... and what do we mostly use in PHP? The "array"! In most cases, we do everything and anything with it but we stumble upon it when profiling code. During this session, we'll learn again to use the structures appropriately, leaning closer on the way to employ arrays, the SPL and other structures from PHP extensions as well.The impact that PHP 7 should have on data structures will be introduced as well.
This document discusses Java collections frameworks. It covers core collection interfaces like List, Set, Queue and Map. It also discusses concrete collection classes that implement these interfaces like ArrayList, LinkedList, HashSet, TreeSet, HashMap and TreeMap. The document further explains concepts like iterators, generics in collections and differences between collections before and after generics.
This document provides tips and tricks for installing Kotlin programming tools and covers fundamental Kotlin concepts like data types, variables, functions, control flow structures, and loops. It discusses installing Kotlin and resolving common errors. It introduces basic Kotlin syntax for strings, numbers, Booleans, arrays, and more. It also covers if/else expressions, when expressions, enums, loops like while, for, and for-each, and break/continue functionality. The document encourages practicing exercises to continue learning Kotlin.
Functional Patterns for the non-mathematicianBrian Lonsdorf
Fluentconf 2014 talk:
Functional design patterns such as lenses, arrows, functors, and monads all come from category theory. To fully grok them, you’ll probably have to wade through the whitest white papers, fighting the mathematical syntax and abstract examples.
I’m hoping to demonstrate the ideas into javascript. I’ll be showing direct and practical applications for every day programming.
The Ring programming language version 1.8 book - Part 75 of 202Mahmoud Samir Fayed
This document describes the code for a basic notepad application created using the Ring programming language. It defines functions for opening, saving, and editing text files. The application features a menu bar, toolbars, dockable panels for a file tree and text editor, and basic text editing functionality like font selection, find/replace, and print.
The Ring programming language version 1.10 book - Part 54 of 212Mahmoud Samir Fayed
This document describes code related to user registration and login functionality in Ring. It includes code for a registration form, login form, user registration logic, login validation, and checking if a user is logged in. Database and model classes are also shown that handle connecting to the database, querying for users, and managing user data.
This document discusses Java 8 streams and provides examples of:
- Creating streams from collections, arrays, and iterators
- Common intermediate stream operations like filter, map, and distinct
- Terminal stream operations like forEach, collect, and reduce
- Features of streams like laziness and lack of storage
- Parallel stream processing and ensuring non-interference with source data
- Best practices for stateless parallel stream operations
This document discusses refactoring Java code to Clojure using macros. It provides examples of refactoring Java code that uses method chaining to equivalent Clojure code using the threading macros (->> and -<>). It also discusses other Clojure features like type hints, the doto macro, and polyglot projects using Leiningen.
Kotlin Coroutines Flow is coming to provide a cold asynchronous data stream that emits values sequentially within a coroutine. Flow allows mapping, filtering, and collecting values, handles exceptions transparently, and preserves context. It can integrate with existing APIs like Room and Retrofit using adapters, and is the primary way to handle async streams going forward. Channels will still be used for hot streams and synchronization between coroutines.
This document provides an introduction to Akka.NET Streams and Reactive Streams. It discusses key concepts like observables, async enumerables, and reactive streams. It also demonstrates how to build workflows with Akka.NET streams, including examples of building a TCP server. The document introduces core Akka.NET streams concepts like sources, flows, and sinks, and how they compose together in a runnable graph. It also covers testing streams with probes and materialization.
Wprowadzenie do technologii Big Data / Intro to Big Data EcosystemSages
Introduction to Hadoop Map Reduce, Pig, Hive and Ambari technologies.
Workshop deck prepared and presented on September 5th 2015 by Radosław Stankiewicz.
During that the day participants had also the possibility to go through prepared tutorials and test their analysis on real cluster.
This document provides an introduction and overview of FS2, a functional streaming library for Scala. It defines what a stream is, explains the difference between pull-based and push-based streams, and demonstrates various features of the FS2 API including working with pure and effectful streams, composing streams, zipping streams, and using streams to interact with external systems through eval and bracket patterns. It also introduces the Pull abstraction for processing stream chunks and provides examples of implementing a windowed aggregation operator using Pull. Finally, it outlines some areas to explore like covariance, concurrency and interoperability with other libraries.
The document discusses programming with futures in Java and Scala. It introduces futures in Java 8 using CompletableFuture and shows how they allow composing asynchronous operations without blocking threads. It then discusses how streams and futures in Java 8 share similar composition concepts using thenApply and thenCompose. The talk moves on to introduce more abstract concepts from category theory - monads, foldables and monoids. It shows how these concepts can be implemented for futures and lists to provide generic sequencing and folding of asynchronous and synchronous operations in a precise way.
A quick overview of CAVE, a managed service for monitoring infrastructure, platform, and application metrics, to provide visibility into your system's performance and operational levels. CAVE is built at GILT, using Scala, Play and Akka.
Let if flow: Java 8 Streams puzzles and moreBhakti Mehta
This talk covers Java 8 Streams in details and using programming puzzles will discuss about various techniques with Streams: how to do complex data processing , queries with Streams API, how to use all the goodies like map, flatMap,filter, how to group, and partition data, how to use infinite streams, parallel streams, creating lazy lists.
If you are a beginner or a pro with Java 8 wanting to challenge your knowledge there is something for all!
This document provides an introduction to Apache Flink. It begins with an overview of the presenters and structure of the presentation. It then discusses Flink's APIs, architecture, and execution model. Key concepts are explained like streaming vs batch processing, scaling, the job manager and task managers. It provides a demo of Flink's DataSet API for batch processing and explains a WordCount example program. The goal is to get attendees started with Apache Flink.
The document shows examples of using lambda functions and functional programming techniques in various languages like JavaScript, Python, C#, and Java. It demonstrates how to define anonymous functions, map, filter and reduce collections, use closures, and more. Key examples include summing a list of integers with reduce, filtering even numbers from a list, mapping string transformations, and converting a list of strings to uppercase.
This document discusses various functional programming concepts in Java using Guava libraries. It covers Guava features like FluentIterable to transform and filter collections, Optional to avoid null checks, Predicate interfaces to filter collections, Function interfaces to transform objects, and LoadingCache to cache method results. It also shows how to use Joiner to concatenate strings and describes other Guava utilities like Collections, EventBus, Ordering and Preconditions.
Asynchronous web apps with the Play Framework 2.0Oscar Renalias
This document discusses Play's asynchronous capabilities for building scalable and responsive web applications. It begins by explaining the traditional blocking request processing model and Play's asynchronous non-blocking model. It then covers asynchronous requests using Futures and Promises in Play. Examples are provided for making actions asynchronous using asynchronous responses. The document also discusses reactive IO in Play using Enumerators and Iteratees for non-blocking streaming of data. Real world use cases for asynchronous programming include asynchronous web services, streaming files and data, and websockets.
FS2 (previously called Scalaz-Stream) is a library that facilitates purely functional API to encode stream processing in a modular and composable manner.
Due to its functional abstraction around "streams" of data, FS2 enables isolating and delaying the side-effects until the streams are fully composed and assembled into its final execution context.
The main objectives of this talk are to get started with FS2, particularly with its functional approach to stream processing, and to dive into details of its semantics.
Streaming Data Flow with Apache Flink @ Paris Flink Meetup 2015Till Rohrmann
Apache Flink is an open source platform for distributed stream and batch data processing. It provides APIs called DataStream for unbounded streaming data and DataSet for bounded batch data. Flink runs streaming topologies that allow for windowing, aggregation and other stream processing functions. It supports exactly-once processing semantics through distributed snapshots and checkpoints. The system is optimized for low latency and high throughput streaming applications.
ITT 2015 - Saul Mora - Object Oriented Function ProgrammingIstanbul Tech Talks
Functional programming is finally a first class citizen in the Cocoa toolset! But, as you may have heard, Swift is not necessarily a pure functional language. And in embracing the functional paradigm, do you need to throw out your knowledge and experience with Object Oriented programming? Saul Mora shows that it turns out you can have your cake and eat it too!
Reactive stream processing using Akka streams Johan Andrén
This document discusses Akka streams and Reactive Streams. It provides an example of creating an Akka streams application that exposes an HTTP service serving an infinite stream of numbers. The example demonstrates how Akka streams provides asynchronous stream processing with back pressure to prevent out of memory errors.
To Infinity & Beyond: Protocols & sequences in Node - Part 2Bahul Neel Upadhyaya
This document summarizes Bahul Neel Upadhyaya's presentation on protocols and lazy sequences in Node using the Cosy library. The presentation introduces concepts like protocols, lazy sequences, tail recursion and object metadata. It provides an example of implementing term frequency-inverse document frequency (TF-IDF) using Cosy. It also describes making sequences asynchronous and integrating Socket.IO for both server and client to demonstrate streaming TF-IDF results over the network. Future work mentioned includes queues, persistent data structures and graphs.
These are the outline slides that I used for the Pune Clojure Course.
The slides may not be much useful standalone, but I have uploaded them for reference.
A practical guide to using RxJava on Android. Tips for improving your app architecture with reactive programming. What are the advantages and disadvantages of using RxJava over standard architecture? And how to connect with other popular Android libraries?
Presented at Droidcon Greece 2016.
Similar to Практическое применения Akka Streams (20)
Unlock the Secrets to Effortless Video Creation with Invideo: Your Ultimate G...The Third Creative Media
"Navigating Invideo: A Comprehensive Guide" is an essential resource for anyone looking to master Invideo, an AI-powered video creation tool. This guide provides step-by-step instructions, helpful tips, and comparisons with other AI video creators. Whether you're a beginner or an experienced video editor, you'll find valuable insights to enhance your video projects and bring your creative ideas to life.
How Can Hiring A Mobile App Development Company Help Your Business Grow?ToXSL Technologies
ToXSL Technologies is an award-winning Mobile App Development Company in Dubai that helps businesses reshape their digital possibilities with custom app services. As a top app development company in Dubai, we offer highly engaging iOS & Android app solutions. https://rb.gy/necdnt
Odoo releases a new update every year. The latest version, Odoo 17, came out in October 2023. It brought many improvements to the user interface and user experience, along with new features in modules like accounting, marketing, manufacturing, websites, and more.
The Odoo 17 update has been a hot topic among startups, mid-sized businesses, large enterprises, and Odoo developers aiming to grow their businesses. Since it is now already the first quarter of 2024, you must have a clear idea of what Odoo 17 entails and what it can offer your business if you are still not aware of it.
This blog covers the features and functionalities. Explore the entire blog and get in touch with expert Odoo ERP consultants to leverage Odoo 17 and its features for your business too.
An Overview of Odoo ERP
Odoo ERP was first released as OpenERP software in February 2005. It is a suite of business applications used for ERP, CRM, eCommerce, websites, and project management. Ten years ago, the Odoo Enterprise edition was launched to help fund the Odoo Community version.
When you compare Odoo Community and Enterprise, the Enterprise edition offers exclusive features like mobile app access, Odoo Studio customisation, Odoo hosting, and unlimited functional support.
Today, Odoo is a well-known name used by companies of all sizes across various industries, including manufacturing, retail, accounting, marketing, healthcare, IT consulting, and R&D.
The latest version, Odoo 17, has been available since October 2023. Key highlights of this update include:
Enhanced user experience with improvements to the command bar, faster backend page loading, and multiple dashboard views.
Instant report generation, credit limit alerts for sales and invoices, separate OCR settings for invoice creation, and an auto-complete feature for forms in the accounting module.
Improved image handling and global attribute changes for mailing lists in email marketing.
A default auto-signature option and a refuse-to-sign option in HR modules.
Options to divide and merge manufacturing orders, track the status of manufacturing orders, and more in the MRP module.
Dark mode in Odoo 17.
Now that the Odoo 17 announcement is official, let’s look at what’s new in Odoo 17!
What is Odoo ERP 17?
Odoo 17 is the latest version of one of the world’s leading open-source enterprise ERPs. This version has come up with significant improvements explained here in this blog. Also, this new version aims to introduce features that enhance time-saving, efficiency, and productivity for users across various organisations.
Odoo 17, released at the Odoo Experience 2023, brought notable improvements to the user interface and added new functionalities with enhancements in performance, accessibility, data analysis, and management, further expanding its reach in the market.
UI5con 2024 - Bring Your Own Design SystemPeter Muessig
How do you combine the OpenUI5/SAPUI5 programming model with a design system that makes its controls available as Web Components? Since OpenUI5/SAPUI5 1.120, the framework supports the integration of any Web Components. This makes it possible, for example, to natively embed own Web Components of your design system which are created with Stencil. The integration embeds the Web Components in a way that they can be used naturally in XMLViews, like with standard UI5 controls, and can be bound with data binding. Learn how you can also make use of the Web Components base class in OpenUI5/SAPUI5 to also integrate your Web Components and get inspired by the solution to generate a custom UI5 library providing the Web Components control wrappers for the native ones.
A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...kalichargn70th171
In today's fiercely competitive mobile app market, the role of the QA team is pivotal for continuous improvement and sustained success. Effective testing strategies are essential to navigate the challenges confidently and precisely. Ensuring the perfection of mobile apps before they reach end-users requires thoughtful decisions in the testing plan.
Project Management: The Role of Project Dashboards.pdfKarya Keeper
Project management is a crucial aspect of any organization, ensuring that projects are completed efficiently and effectively. One of the key tools used in project management is the project dashboard, which provides a comprehensive view of project progress and performance. In this article, we will explore the role of project dashboards in project management, highlighting their key features and benefits.
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdfVALiNTRY360
Salesforce Healthcare CRM, implemented by VALiNTRY360, revolutionizes patient management by enhancing patient engagement, streamlining administrative processes, and improving care coordination. Its advanced analytics, robust security, and seamless integration with telehealth services ensure that healthcare providers can deliver personalized, efficient, and secure patient care. By automating routine tasks and providing actionable insights, Salesforce Healthcare CRM enables healthcare providers to focus on delivering high-quality care, leading to better patient outcomes and higher satisfaction. VALiNTRY360's expertise ensures a tailored solution that meets the unique needs of any healthcare practice, from small clinics to large hospital systems.
For more info visit us https://valintry360.com/solutions/health-life-sciences
The Key to Digital Success_ A Comprehensive Guide to Continuous Testing Integ...kalichargn70th171
In today's business landscape, digital integration is ubiquitous, demanding swift innovation as a necessity rather than a luxury. In a fiercely competitive market with heightened customer expectations, the timely launch of flawless digital products is crucial for both acquisition and retention—any delay risks ceding market share to competitors.
Consistent toolbox talks are critical for maintaining workplace safety, as they provide regular opportunities to address specific hazards and reinforce safe practices.
These brief, focused sessions ensure that safety is a continual conversation rather than a one-time event, which helps keep safety protocols fresh in employees' minds. Studies have shown that shorter, more frequent training sessions are more effective for retention and behavior change compared to longer, infrequent sessions.
Engaging workers regularly, toolbox talks promote a culture of safety, empower employees to voice concerns, and ultimately reduce the likelihood of accidents and injuries on site.
The traditional method of conducting safety talks with paper documents and lengthy meetings is not only time-consuming but also less effective. Manual tracking of attendance and compliance is prone to errors and inconsistencies, leading to gaps in safety communication and potential non-compliance with OSHA regulations. Switching to a digital solution like Safelyio offers significant advantages.
Safelyio automates the delivery and documentation of safety talks, ensuring consistency and accessibility. The microlearning approach breaks down complex safety protocols into manageable, bite-sized pieces, making it easier for employees to absorb and retain information.
This method minimizes disruptions to work schedules, eliminates the hassle of paperwork, and ensures that all safety communications are tracked and recorded accurately. Ultimately, using a digital platform like Safelyio enhances engagement, compliance, and overall safety performance on site. https://safelyio.com/
E-commerce Development Services- Hornet DynamicsHornet Dynamics
For any business hoping to succeed in the digital age, having a strong online presence is crucial. We offer Ecommerce Development Services that are customized according to your business requirements and client preferences, enabling you to create a dynamic, safe, and user-friendly online store.
14 th Edition of International conference on computer visionShulagnaSarkar2
About the event
14th Edition of International conference on computer vision
Computer conferences organized by ScienceFather group. ScienceFather takes the privilege to invite speakers participants students delegates and exhibitors from across the globe to its International Conference on computer conferences to be held in the Various Beautiful cites of the world. computer conferences are a discussion of common Inventions-related issues and additionally trade information share proof thoughts and insight into advanced developments in the science inventions service system. New technology may create many materials and devices with a vast range of applications such as in Science medicine electronics biomaterials energy production and consumer products.
Nomination are Open!! Don't Miss it
Visit: computer.scifat.com
Award Nomination: https://x-i.me/ishnom
Conference Submission: https://x-i.me/anicon
For Enquiry: Computer@scifat.com
Microservice Teams - How the cloud changes the way we workSven Peters
A lot of technical challenges and complexity come with building a cloud-native and distributed architecture. The way we develop backend software has fundamentally changed in the last ten years. Managing a microservices architecture demands a lot of us to ensure observability and operational resiliency. But did you also change the way you run your development teams?
Sven will talk about Atlassian’s journey from a monolith to a multi-tenanted architecture and how it affected the way the engineering teams work. You will learn how we shifted to service ownership, moved to more autonomous teams (and its challenges), and established platform and enablement teams.
Enhanced Screen Flows UI/UX using SLDS with Tom KittPeter Caitens
Join us for an engaging session led by Flow Champion, Tom Kitt. This session will dive into a technique of enhancing the user interfaces and user experiences within Screen Flows using the Salesforce Lightning Design System (SLDS). This technique uses Native functionality, with No Apex Code, No Custom Components and No Managed Packages required.
UI5con 2024 - Boost Your Development Experience with UI5 Tooling ExtensionsPeter Muessig
The UI5 tooling is the development and build tooling of UI5. It is built in a modular and extensible way so that it can be easily extended by your needs. This session will showcase various tooling extensions which can boost your development experience by far so that you can really work offline, transpile your code in your project to use even newer versions of EcmaScript (than 2022 which is supported right now by the UI5 tooling), consume any npm package of your choice in your project, using different kind of proxies, and even stitching UI5 projects during development together to mimic your target environment.
107. • Читать данные из очереди и обрабатывать.
36
Задача
Source Process Sink
Future
108. 37
Красивый код на стримах
val source = ZMQSource(context,
mode = ZMQ.PULL,
timeout = 1 second,
addresses = List("tcp: //127.0.0.1:12345")
)
def process(in: ByteString): Future[Int] = ???
109. 37
Красивый код на стримах
val source = ZMQSource(context,
mode = ZMQ.PULL,
timeout = 1 second,
addresses = List("tcp: //127.0.0.1:12345")
)
def process(in: ByteString): Future[Int] = ???
110. 37
Красивый код на стримах
val source = ZMQSource(context,
mode = ZMQ.PULL,
timeout = 1 second,
addresses = List("tcp: //127.0.0.1:12345")
)
def process(in: ByteString): Future[Int] = ???
111. 37
Красивый код на стримах
val source = ZMQSource(context,
mode = ZMQ.PULL,
timeout = 1 second,
addresses = List("tcp: //127.0.0.1:12345")
)
def process(in: ByteString): Future[Int] = ???
112. 38
Красивый код на стримах
val stream = source
.mapAsync(10)(process)
.toMat(Sink.last)(Keep.right)
val result: Future[Int] = stream.run()
result.onComplete(_ => "We are done here")
113. 38
Красивый код на стримах
val stream = source
.mapAsync(10)(process)
.toMat(Sink.last)(Keep.right)
val result: Future[Int] = stream.run()
result.onComplete(_ => "We are done here")
114. 38
Красивый код на стримах
val stream = source
.mapAsync(10)(process)
.toMat(Sink.last)(Keep.right)
val result: Future[Int] = stream.run()
result.onComplete(_ => "We are done here")
115. 38
Красивый код на стримах
val stream = source
.mapAsync(10)(process)
.toMat(Sink.last)(Keep.right)
val result: Future[Int] = stream.run()
result.onComplete(_ => "We are done here")
116. 38
Красивый код на стримах
val stream = source
.mapAsync(10)(process)
.toMat(Sink.last)(Keep.right)
val result: Future[Int] = stream.run()
result.onComplete(_ => "We are done here")
124. 43
Проблема остановки
trait Control {
/**
* Disconnect the underlying ZMQ socket, deliver the
remaining data and finally close the socket.
*/
def gracefulStop(): Unit
}
125. 44
Проблема остановки
val source: Source[ByteString, Control] = ???
val stream: RunnableGraph[(Control, Future[Int])] =
source
.mapAsync(10)(process)
.toMat(Sink.head)(Keep.both)
val (control: Control, result: Future[Int]) = stream.run()
result.onComplete(_ => "We are done here")
control.gracefulStop()
126. 44
Проблема остановки
val source: Source[ByteString, Control] = ???
val stream: RunnableGraph[(Control, Future[Int])] =
source
.mapAsync(10)(process)
.toMat(Sink.head)(Keep.both)
val (control: Control, result: Future[Int]) = stream.run()
result.onComplete(_ => "We are done here")
control.gracefulStop()
127. 44
Проблема остановки
val source: Source[ByteString, Control] = ???
val stream: RunnableGraph[(Control, Future[Int])] =
source
.mapAsync(10)(process)
.toMat(Sink.head)(Keep.both)
val (control: Control, result: Future[Int]) = stream.run()
result.onComplete(_ => "We are done here")
control.gracefulStop()
128. 44
Проблема остановки
val source: Source[ByteString, Control] = ???
val stream: RunnableGraph[(Control, Future[Int])] =
source
.mapAsync(10)(process)
.toMat(Sink.head)(Keep.both)
val (control: Control, result: Future[Int]) = stream.run()
result.onComplete(_ => "We are done here")
control.gracefulStop()
129. 44
Проблема остановки
val source: Source[ByteString, Control] = ???
val stream: RunnableGraph[(Control, Future[Int])] =
source
.mapAsync(10)(process)
.toMat(Sink.head)(Keep.both)
val (control: Control, result: Future[Int]) = stream.run()
result.onComplete(_ => "We are done here")
control.gracefulStop()
130. 44
Проблема остановки
val source: Source[ByteString, Control] = ???
val stream: RunnableGraph[(Control, Future[Int])] =
source
.mapAsync(10)(process)
.toMat(Sink.head)(Keep.both)
val (control: Control, result: Future[Int]) = stream.run()
result.onComplete(_ => "We are done here")
control.gracefulStop()
137. • Emit элемента
• Завершение
• Ошибка
• Backpressure
• Отмена
47
Что нужно знать про stages
138. 48
Свой Source
val s: Source[Int, ActorRef] =
Source.actorPublisher[Int](Props(new MySourceActor))
class MySourceActor extends ActorPublisher[Int] {
override def receive: Receive = {
case ActorPublisherMessage.Request(n) =>
onNext(100)
onCompleteThenStop()
onErrorThenStop(new Exception)
case ActorPublisherMessage.Cancel =>
context.stop(self)
}
}
139. 48
Свой Source
val s: Source[Int, ActorRef] =
Source.actorPublisher[Int](Props(new MySourceActor))
class MySourceActor extends ActorPublisher[Int] {
override def receive: Receive = {
case ActorPublisherMessage.Request(n) =>
onNext(100)
onCompleteThenStop()
onErrorThenStop(new Exception)
case ActorPublisherMessage.Cancel =>
context.stop(self)
}
}
140. 48
Свой Source
val s: Source[Int, ActorRef] =
Source.actorPublisher[Int](Props(new MySourceActor))
class MySourceActor extends ActorPublisher[Int] {
override def receive: Receive = {
case ActorPublisherMessage.Request(n) =>
onNext(100)
onCompleteThenStop()
onErrorThenStop(new Exception)
case ActorPublisherMessage.Cancel =>
context.stop(self)
}
}
141. 48
Свой Source
val s: Source[Int, ActorRef] =
Source.actorPublisher[Int](Props(new MySourceActor))
class MySourceActor extends ActorPublisher[Int] {
override def receive: Receive = {
case ActorPublisherMessage.Request(n) =>
onNext(100)
onCompleteThenStop()
onErrorThenStop(new Exception)
case ActorPublisherMessage.Cancel =>
context.stop(self)
}
}
142. 48
Свой Source
val s: Source[Int, ActorRef] =
Source.actorPublisher[Int](Props(new MySourceActor))
class MySourceActor extends ActorPublisher[Int] {
override def receive: Receive = {
case ActorPublisherMessage.Request(n) =>
onNext(100)
onCompleteThenStop()
onErrorThenStop(new Exception)
case ActorPublisherMessage.Cancel =>
context.stop(self)
}
}
143. 48
Свой Source
val s: Source[Int, ActorRef] =
Source.actorPublisher[Int](Props(new MySourceActor))
class MySourceActor extends ActorPublisher[Int] {
override def receive: Receive = {
case ActorPublisherMessage.Request(n) =>
onNext(100)
onCompleteThenStop()
onErrorThenStop(new Exception)
case ActorPublisherMessage.Cancel =>
context.stop(self)
}
}
144. 48
Свой Source
val s: Source[Int, ActorRef] =
Source.actorPublisher[Int](Props(new MySourceActor))
class MySourceActor extends ActorPublisher[Int] {
override def receive: Receive = {
case ActorPublisherMessage.Request(n) =>
onNext(100)
onCompleteThenStop()
onErrorThenStop(new Exception)
case ActorPublisherMessage.Cancel =>
context.stop(self)
}
}
145. 48
Свой Source
val s: Source[Int, ActorRef] =
Source.actorPublisher[Int](Props(new MySourceActor))
class MySourceActor extends ActorPublisher[Int] {
override def receive: Receive = {
case ActorPublisherMessage.Request(n) =>
onNext(100)
onCompleteThenStop()
onErrorThenStop(new Exception)
case ActorPublisherMessage.Cancel =>
context.stop(self)
}
}
146. 48
Свой Source
val s: Source[Int, ActorRef] =
Source.actorPublisher[Int](Props(new MySourceActor))
class MySourceActor extends ActorPublisher[Int] {
override def receive: Receive = {
case ActorPublisherMessage.Request(n) =>
onNext(100)
onCompleteThenStop()
onErrorThenStop(new Exception)
case ActorPublisherMessage.Cancel =>
context.stop(self)
}
}
147. 48
Свой Source
val s: Source[Int, ActorRef] =
Source.actorPublisher[Int](Props(new MySourceActor))
class MySourceActor extends ActorPublisher[Int] {
override def receive: Receive = {
case ActorPublisherMessage.Request(n) =>
onNext(100)
onCompleteThenStop()
onErrorThenStop(new Exception)
case ActorPublisherMessage.Cancel =>
context.stop(self)
}
}
148. 49
Reactive Zmq
case object GracefulStop
case object DeliverMore
class MySourceActor(addr: String)
extends ActorPublisher[Array[Byte]] {
var conn: ZMQ.Socket = ???
override def preStart(): Unit = {
conn.connect(addr)
}
override def postStop(): Unit = {
conn.disconnect(addr)
}
149. 49
Reactive Zmq
case object GracefulStop
case object DeliverMore
class MySourceActor(addr: String)
extends ActorPublisher[Array[Byte]] {
var conn: ZMQ.Socket = ???
override def preStart(): Unit = {
conn.connect(addr)
}
override def postStop(): Unit = {
conn.disconnect(addr)
}
150. 49
Reactive Zmq
case object GracefulStop
case object DeliverMore
class MySourceActor(addr: String)
extends ActorPublisher[Array[Byte]] {
var conn: ZMQ.Socket = ???
override def preStart(): Unit = {
conn.connect(addr)
}
override def postStop(): Unit = {
conn.disconnect(addr)
}
151. 49
Reactive Zmq
case object GracefulStop
case object DeliverMore
class MySourceActor(addr: String)
extends ActorPublisher[Array[Byte]] {
var conn: ZMQ.Socket = ???
override def preStart(): Unit = {
conn.connect(addr)
}
override def postStop(): Unit = {
conn.disconnect(addr)
}
152. 49
Reactive Zmq
case object GracefulStop
case object DeliverMore
class MySourceActor(addr: String)
extends ActorPublisher[Array[Byte]] {
var conn: ZMQ.Socket = ???
override def preStart(): Unit = {
conn.connect(addr)
}
override def postStop(): Unit = {
conn.disconnect(addr)
}
153. 49
Reactive Zmq
case object GracefulStop
case object DeliverMore
class MySourceActor(addr: String)
extends ActorPublisher[Array[Byte]] {
var conn: ZMQ.Socket = ???
override def preStart(): Unit = {
conn.connect(addr)
}
override def postStop(): Unit = {
conn.disconnect(addr)
}
154. 49
Reactive Zmq
case object GracefulStop
case object DeliverMore
class MySourceActor(addr: String)
extends ActorPublisher[Array[Byte]] {
var conn: ZMQ.Socket = ???
override def preStart(): Unit = {
conn.connect(addr)
}
override def postStop(): Unit = {
conn.disconnect(addr)
}
155. 50
Reactive Zmq
override def receive: Receive = {
case ActorPublisherMessage.Request(_) | DeliverMore =>
Option(conn.recv()) match {
case Some(msg) =>
onNext(msg)
if(totalDemand > 0) self ! DeliverMore
case None => self ! DeliverMore
}
case ActorPublisherMessage.Cancel | GracefulStop =>
conn.disconnect(addr)
onCompleteThenStop()
}
156. 50
Reactive Zmq
override def receive: Receive = {
case ActorPublisherMessage.Request(_) | DeliverMore =>
Option(conn.recv()) match {
case Some(msg) =>
onNext(msg)
if(totalDemand > 0) self ! DeliverMore
case None => self ! DeliverMore
}
case ActorPublisherMessage.Cancel | GracefulStop =>
conn.disconnect(addr)
onCompleteThenStop()
}
157. 50
Reactive Zmq
override def receive: Receive = {
case ActorPublisherMessage.Request(_) | DeliverMore =>
Option(conn.recv()) match {
case Some(msg) =>
onNext(msg)
if(totalDemand > 0) self ! DeliverMore
case None => self ! DeliverMore
}
case ActorPublisherMessage.Cancel | GracefulStop =>
conn.disconnect(addr)
onCompleteThenStop()
}
158. 50
Reactive Zmq
override def receive: Receive = {
case ActorPublisherMessage.Request(_) | DeliverMore =>
Option(conn.recv()) match {
case Some(msg) =>
onNext(msg)
if(totalDemand > 0) self ! DeliverMore
case None => self ! DeliverMore
}
case ActorPublisherMessage.Cancel | GracefulStop =>
conn.disconnect(addr)
onCompleteThenStop()
}
159. 50
Reactive Zmq
override def receive: Receive = {
case ActorPublisherMessage.Request(_) | DeliverMore =>
Option(conn.recv()) match {
case Some(msg) =>
onNext(msg)
if(totalDemand > 0) self ! DeliverMore
case None => self ! DeliverMore
}
case ActorPublisherMessage.Cancel | GracefulStop =>
conn.disconnect(addr)
onCompleteThenStop()
}
160. 50
Reactive Zmq
override def receive: Receive = {
case ActorPublisherMessage.Request(_) | DeliverMore =>
Option(conn.recv()) match {
case Some(msg) =>
onNext(msg)
if(totalDemand > 0) self ! DeliverMore
case None => self ! DeliverMore
}
case ActorPublisherMessage.Cancel | GracefulStop =>
conn.disconnect(addr)
onCompleteThenStop()
}
161. 50
Reactive Zmq
override def receive: Receive = {
case ActorPublisherMessage.Request(_) | DeliverMore =>
Option(conn.recv()) match {
case Some(msg) =>
onNext(msg)
if(totalDemand > 0) self ! DeliverMore
case None => self ! DeliverMore
}
case ActorPublisherMessage.Cancel | GracefulStop =>
conn.disconnect(addr)
onCompleteThenStop()
}
162. 50
Reactive Zmq
override def receive: Receive = {
case ActorPublisherMessage.Request(_) | DeliverMore =>
Option(conn.recv()) match {
case Some(msg) =>
onNext(msg)
if(totalDemand > 0) self ! DeliverMore
case None => self ! DeliverMore
}
case ActorPublisherMessage.Cancel | GracefulStop =>
conn.disconnect(addr)
onCompleteThenStop()
}
163. 50
Reactive Zmq
override def receive: Receive = {
case ActorPublisherMessage.Request(_) | DeliverMore =>
Option(conn.recv()) match {
case Some(msg) =>
onNext(msg)
if(totalDemand > 0) self ! DeliverMore
case None => self ! DeliverMore
}
case ActorPublisherMessage.Cancel | GracefulStop =>
conn.disconnect(addr)
onCompleteThenStop()
}
164. 50
Reactive Zmq
override def receive: Receive = {
case ActorPublisherMessage.Request(_) | DeliverMore =>
Option(conn.recv()) match {
case Some(msg) =>
onNext(msg)
if(totalDemand > 0) self ! DeliverMore
case None => self ! DeliverMore
}
case ActorPublisherMessage.Cancel | GracefulStop =>
conn.disconnect(addr)
onCompleteThenStop()
}
165. 50
Reactive Zmq
override def receive: Receive = {
case ActorPublisherMessage.Request(_) | DeliverMore =>
Option(conn.recv()) match {
case Some(msg) =>
onNext(msg)
if(totalDemand > 0) self ! DeliverMore
case None => self ! DeliverMore
}
case ActorPublisherMessage.Cancel | GracefulStop =>
conn.disconnect(addr)
onCompleteThenStop()
}
166. 51
Reactive Zmq
val source: Source[Array[Byte], Control] =
Source.actorPublisher[Array[Byte]](
Props(new MySourceActor( ???))
).mapMaterializedValue { ref =>
new Control {
override def gracefulStop() = ref ! GracefulStop
}
}
167. 51
Reactive Zmq
val source: Source[Array[Byte], Control] =
Source.actorPublisher[Array[Byte]](
Props(new MySourceActor( ???))
).mapMaterializedValue { ref =>
new Control {
override def gracefulStop() = ref ! GracefulStop
}
}
168. 51
Reactive Zmq
val source: Source[Array[Byte], Control] =
Source.actorPublisher[Array[Byte]](
Props(new MySourceActor( ???))
).mapMaterializedValue { ref =>
new Control {
override def gracefulStop() = ref ! GracefulStop
}
}
169. 51
Reactive Zmq
val source: Source[Array[Byte], Control] =
Source.actorPublisher[Array[Byte]](
Props(new MySourceActor( ???))
).mapMaterializedValue { ref =>
new Control {
override def gracefulStop() = ref ! GracefulStop
}
}
170. 51
Reactive Zmq
val source: Source[Array[Byte], Control] =
Source.actorPublisher[Array[Byte]](
Props(new MySourceActor( ???))
).mapMaterializedValue { ref =>
new Control {
override def gracefulStop() = ref ! GracefulStop
}
}
171. 51
Reactive Zmq
val source: Source[Array[Byte], Control] =
Source.actorPublisher[Array[Byte]](
Props(new MySourceActor( ???))
).mapMaterializedValue { ref =>
new Control {
override def gracefulStop() = ref ! GracefulStop
}
}
172. 51
Reactive Zmq
val source: Source[Array[Byte], Control] =
Source.actorPublisher[Array[Byte]](
Props(new MySourceActor( ???))
).mapMaterializedValue { ref =>
new Control {
override def gracefulStop() = ref ! GracefulStop
}
}
173. 52
Свой Sink
val s = Sink.actorSubscriber[Int](Props(new MySinkActor))
class MySinkActor extends ActorSubscriber {
override def receive: Receive = {
case ActorSubscriberMessage.OnNext =>
cancel()
request(100)
case ActorSubscriberMessage.OnComplete =>
case ActorSubscriberMessage.OnError =>
}
174. 52
Свой Sink
val s = Sink.actorSubscriber[Int](Props(new MySinkActor))
class MySinkActor extends ActorSubscriber {
override def receive: Receive = {
case ActorSubscriberMessage.OnNext =>
cancel()
request(100)
case ActorSubscriberMessage.OnComplete =>
case ActorSubscriberMessage.OnError =>
}
175. 52
Свой Sink
val s = Sink.actorSubscriber[Int](Props(new MySinkActor))
class MySinkActor extends ActorSubscriber {
override def receive: Receive = {
case ActorSubscriberMessage.OnNext =>
cancel()
request(100)
case ActorSubscriberMessage.OnComplete =>
case ActorSubscriberMessage.OnError =>
}
176. 52
Свой Sink
val s = Sink.actorSubscriber[Int](Props(new MySinkActor))
class MySinkActor extends ActorSubscriber {
override def receive: Receive = {
case ActorSubscriberMessage.OnNext =>
cancel()
request(100)
case ActorSubscriberMessage.OnComplete =>
case ActorSubscriberMessage.OnError =>
}
177. 52
Свой Sink
val s = Sink.actorSubscriber[Int](Props(new MySinkActor))
class MySinkActor extends ActorSubscriber {
override def receive: Receive = {
case ActorSubscriberMessage.OnNext =>
cancel()
request(100)
case ActorSubscriberMessage.OnComplete =>
case ActorSubscriberMessage.OnError =>
}
178. 52
Свой Sink
val s = Sink.actorSubscriber[Int](Props(new MySinkActor))
class MySinkActor extends ActorSubscriber {
override def receive: Receive = {
case ActorSubscriberMessage.OnNext =>
cancel()
request(100)
case ActorSubscriberMessage.OnComplete =>
case ActorSubscriberMessage.OnError =>
}
179. 52
Свой Sink
val s = Sink.actorSubscriber[Int](Props(new MySinkActor))
class MySinkActor extends ActorSubscriber {
override def receive: Receive = {
case ActorSubscriberMessage.OnNext =>
cancel()
request(100)
case ActorSubscriberMessage.OnComplete =>
case ActorSubscriberMessage.OnError =>
}
180. 52
Свой Sink
val s = Sink.actorSubscriber[Int](Props(new MySinkActor))
class MySinkActor extends ActorSubscriber {
override def receive: Receive = {
case ActorSubscriberMessage.OnNext =>
cancel()
request(100)
case ActorSubscriberMessage.OnComplete =>
case ActorSubscriberMessage.OnError =>
}
181. 52
Свой Sink
val s = Sink.actorSubscriber[Int](Props(new MySinkActor))
class MySinkActor extends ActorSubscriber {
override def receive: Receive = {
case ActorSubscriberMessage.OnNext =>
cancel()
request(100)
case ActorSubscriberMessage.OnComplete =>
case ActorSubscriberMessage.OnError =>
}