A introduction about main functionalities of Celluloid, a Ruby Actor Model implementation, and some of famous libraries that uses it - Celluloid::IO, DCell and Reel.
KCDC 2018 - Rapid API Development with SailsJustin James
Creating a RESTful API should be the easiest part of your development. You should not have to be a rocket scientist to successfully create a RESTful API. With Sails, you can create a full featured RESTful API in just a few minutes without writing any code. You get create, destroy, update, find, paginate, sort, and filtering out of the box. If you need to add your business logic to any of the methods or create your own methods, you can do that by writing simple JavaScript functions. Once you are ready to implement security, Sails provides policies that can be applied to any REST action to implement email/password, social login or Windows authentication. For data storage, Sails bundles the power ORM, Waterline, which provides a simple data access layer that just works, no matter which one of the more than 30 data storage providers you are using.
This talk will be code heavy as we walk through getting started with Sails and demonstrate how to implement the features of Sails through the creation of an API. As well, I will share the tips and tricks that I have learned using Sails at a Fortune 100 company. You will walk away understanding how and why you should use Sails on your next project. All code covered in the talk with be immediately available for download.
Java 8 Puzzlers as it was presented at Codemash 2017Baruch Sadogursky
We aren’t sure about you, but working with Java 8 made one of the speakers lose all of his hair and the other lose his sleep (or was it the jetlag?). If you still haven’t reached the level of Brian Goetz in mastering lambdas and strings, this talk is for you. And if you think you have, we have some bad news for you, you should attend as well. Baruch and Viktor will show you some surprising, bizarre, and inconceivable parts of Java 8 and make sure that you won’t be (too) surprised when it hits you in production. As with any other puzzlers talk, there will be two speakers, lots of puzzling questions, answers by the audience, T-shirts flying around, and a lot of fun, all for one purpose—to help you better understand Java 8.
Sprockets is an easy solution to managing large JavaScript codebases by letting you structure it, bundle it with related assets, and consolidate it as one single file, with pre-baked command-line tooling, CGI front and Rails plugin. It's a framework-agnostic open-source solution that makes for great serving performance while helping you structure and manage your codebase better.
KCDC 2018 - Rapid API Development with SailsJustin James
Creating a RESTful API should be the easiest part of your development. You should not have to be a rocket scientist to successfully create a RESTful API. With Sails, you can create a full featured RESTful API in just a few minutes without writing any code. You get create, destroy, update, find, paginate, sort, and filtering out of the box. If you need to add your business logic to any of the methods or create your own methods, you can do that by writing simple JavaScript functions. Once you are ready to implement security, Sails provides policies that can be applied to any REST action to implement email/password, social login or Windows authentication. For data storage, Sails bundles the power ORM, Waterline, which provides a simple data access layer that just works, no matter which one of the more than 30 data storage providers you are using.
This talk will be code heavy as we walk through getting started with Sails and demonstrate how to implement the features of Sails through the creation of an API. As well, I will share the tips and tricks that I have learned using Sails at a Fortune 100 company. You will walk away understanding how and why you should use Sails on your next project. All code covered in the talk with be immediately available for download.
Java 8 Puzzlers as it was presented at Codemash 2017Baruch Sadogursky
We aren’t sure about you, but working with Java 8 made one of the speakers lose all of his hair and the other lose his sleep (or was it the jetlag?). If you still haven’t reached the level of Brian Goetz in mastering lambdas and strings, this talk is for you. And if you think you have, we have some bad news for you, you should attend as well. Baruch and Viktor will show you some surprising, bizarre, and inconceivable parts of Java 8 and make sure that you won’t be (too) surprised when it hits you in production. As with any other puzzlers talk, there will be two speakers, lots of puzzling questions, answers by the audience, T-shirts flying around, and a lot of fun, all for one purpose—to help you better understand Java 8.
Sprockets is an easy solution to managing large JavaScript codebases by letting you structure it, bundle it with related assets, and consolidate it as one single file, with pre-baked command-line tooling, CGI front and Rails plugin. It's a framework-agnostic open-source solution that makes for great serving performance while helping you structure and manage your codebase better.
Ruby developers need to stop using EventMachine. It's the wrong direction.
Lost in the "Threads vs Event Driven vs Process Spawning" debate is that you can combine them! Learn how Celluloid is improving thread programming by abstracting them using a higher level framework called Celluloid, how you can use Celluloid::IO to throw a reactor pattern into a thread. Using this approach, you can take advantage of threading and use all CPU power on a machine with JRuby or Rubinius. I also discuss the future of distributed objects and computing, and where I think things are going.
cynapspro data endpoint protection 2010 - Installationsleitfadencynapspro GmbH
Installationsleitfaden der intuitiven und effizienten cynapspro Data Endpoint Protection 2010.
Weitere Informationen über die cynapspro Endpoint Data Protection 2010 finden Sie unter http://cynapspro.com/DE/
Here is a presentation on the prospect on outsourcing from Bangladesh. There are verities of outsourcing products are there. To know more please visit http://www.dragonsourcing.com/
Brief del desarrollo de sistema Web transaccional para el transporte de pasajeros con, DW en gxplorer más sistema de pago con tarjeta sin contacto Mifare 1Kb, aplicado a una flota de 300 coches con 6 oficinas de recaudación.
Fintech, Online Brokerage & Online Betting - Presentation by Antonio Rami, Co-Founder & COO of Kantox at the NOAH Conference London 2016, Old Billingsgate on the 11th of November 2016.
Diese Arbeit beschäftigt sich mit konkreten Social Media Anwendungen und Diensten, die dazu geeignet sind, Kaufentscheidungen im E-Commerce positiv zu beeinflussen und Konsumenten durch Mehrwerte im Bereich Kommunikation und Kooperation mit Hilfe von Social Commerce zu loyalisieren.
Füllung – Rahmen - Verriegelung
Bodenschwelle
Wärmeschutz und Dichtigkeit
Markenhaustüren von Kompotherm
Kleinegreber Haustüren, die anziehen aus Gütersloh / Bielefeld
Early Conciliation has been with us for over six months now and stats from Acas indicate they have dealt with 37,000 cases in that time. The scheme requires individuals to contact Acas before lodging an employment tribunal claim against their employer / ex-employer. Alive to the risks involved in employers unwittingly entering into conciliation themselves where in the context of litigation they would ordinarily engage professional employment tribunal representation, we have produced the following podcast examining EC in more detail and providing tips on avoiding the potential pitfalls.
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Jeffrey Haguewood
Sidekick Solutions uses Bonterra Impact Management (fka Social Solutions Apricot) and automation solutions to integrate data for business workflows.
We believe integration and automation are essential to user experience and the promise of efficient work through technology. Automation is the critical ingredient to realizing that full vision. We develop integration products and services for Bonterra Case Management software to support the deployment of automations for a variety of use cases.
This video focuses on the notifications, alerts, and approval requests using Slack for Bonterra Impact Management. The solutions covered in this webinar can also be deployed for Microsoft Teams.
Interested in deploying notification automations for Bonterra Impact Management? Contact us at sales@sidekicksolutionsllc.com to discuss next steps.
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...UiPathCommunity
💥 Speed, accuracy, and scaling – discover the superpowers of GenAI in action with UiPath Document Understanding and Communications Mining™:
See how to accelerate model training and optimize model performance with active learning
Learn about the latest enhancements to out-of-the-box document processing – with little to no training required
Get an exclusive demo of the new family of UiPath LLMs – GenAI models specialized for processing different types of documents and messages
This is a hands-on session specifically designed for automation developers and AI enthusiasts seeking to enhance their knowledge in leveraging the latest intelligent document processing capabilities offered by UiPath.
Speakers:
👨🏫 Andras Palfi, Senior Product Manager, UiPath
👩🏫 Lenka Dulovicova, Product Program Manager, UiPath
Ruby developers need to stop using EventMachine. It's the wrong direction.
Lost in the "Threads vs Event Driven vs Process Spawning" debate is that you can combine them! Learn how Celluloid is improving thread programming by abstracting them using a higher level framework called Celluloid, how you can use Celluloid::IO to throw a reactor pattern into a thread. Using this approach, you can take advantage of threading and use all CPU power on a machine with JRuby or Rubinius. I also discuss the future of distributed objects and computing, and where I think things are going.
cynapspro data endpoint protection 2010 - Installationsleitfadencynapspro GmbH
Installationsleitfaden der intuitiven und effizienten cynapspro Data Endpoint Protection 2010.
Weitere Informationen über die cynapspro Endpoint Data Protection 2010 finden Sie unter http://cynapspro.com/DE/
Here is a presentation on the prospect on outsourcing from Bangladesh. There are verities of outsourcing products are there. To know more please visit http://www.dragonsourcing.com/
Brief del desarrollo de sistema Web transaccional para el transporte de pasajeros con, DW en gxplorer más sistema de pago con tarjeta sin contacto Mifare 1Kb, aplicado a una flota de 300 coches con 6 oficinas de recaudación.
Fintech, Online Brokerage & Online Betting - Presentation by Antonio Rami, Co-Founder & COO of Kantox at the NOAH Conference London 2016, Old Billingsgate on the 11th of November 2016.
Diese Arbeit beschäftigt sich mit konkreten Social Media Anwendungen und Diensten, die dazu geeignet sind, Kaufentscheidungen im E-Commerce positiv zu beeinflussen und Konsumenten durch Mehrwerte im Bereich Kommunikation und Kooperation mit Hilfe von Social Commerce zu loyalisieren.
Füllung – Rahmen - Verriegelung
Bodenschwelle
Wärmeschutz und Dichtigkeit
Markenhaustüren von Kompotherm
Kleinegreber Haustüren, die anziehen aus Gütersloh / Bielefeld
Early Conciliation has been with us for over six months now and stats from Acas indicate they have dealt with 37,000 cases in that time. The scheme requires individuals to contact Acas before lodging an employment tribunal claim against their employer / ex-employer. Alive to the risks involved in employers unwittingly entering into conciliation themselves where in the context of litigation they would ordinarily engage professional employment tribunal representation, we have produced the following podcast examining EC in more detail and providing tips on avoiding the potential pitfalls.
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Jeffrey Haguewood
Sidekick Solutions uses Bonterra Impact Management (fka Social Solutions Apricot) and automation solutions to integrate data for business workflows.
We believe integration and automation are essential to user experience and the promise of efficient work through technology. Automation is the critical ingredient to realizing that full vision. We develop integration products and services for Bonterra Case Management software to support the deployment of automations for a variety of use cases.
This video focuses on the notifications, alerts, and approval requests using Slack for Bonterra Impact Management. The solutions covered in this webinar can also be deployed for Microsoft Teams.
Interested in deploying notification automations for Bonterra Impact Management? Contact us at sales@sidekicksolutionsllc.com to discuss next steps.
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...UiPathCommunity
💥 Speed, accuracy, and scaling – discover the superpowers of GenAI in action with UiPath Document Understanding and Communications Mining™:
See how to accelerate model training and optimize model performance with active learning
Learn about the latest enhancements to out-of-the-box document processing – with little to no training required
Get an exclusive demo of the new family of UiPath LLMs – GenAI models specialized for processing different types of documents and messages
This is a hands-on session specifically designed for automation developers and AI enthusiasts seeking to enhance their knowledge in leveraging the latest intelligent document processing capabilities offered by UiPath.
Speakers:
👨🏫 Andras Palfi, Senior Product Manager, UiPath
👩🏫 Lenka Dulovicova, Product Program Manager, UiPath
Essentials of Automations: Optimizing FME Workflows with ParametersSafe Software
Are you looking to streamline your workflows and boost your projects’ efficiency? Do you find yourself searching for ways to add flexibility and control over your FME workflows? If so, you’re in the right place.
Join us for an insightful dive into the world of FME parameters, a critical element in optimizing workflow efficiency. This webinar marks the beginning of our three-part “Essentials of Automation” series. This first webinar is designed to equip you with the knowledge and skills to utilize parameters effectively: enhancing the flexibility, maintainability, and user control of your FME projects.
Here’s what you’ll gain:
- Essentials of FME Parameters: Understand the pivotal role of parameters, including Reader/Writer, Transformer, User, and FME Flow categories. Discover how they are the key to unlocking automation and optimization within your workflows.
- Practical Applications in FME Form: Delve into key user parameter types including choice, connections, and file URLs. Allow users to control how a workflow runs, making your workflows more reusable. Learn to import values and deliver the best user experience for your workflows while enhancing accuracy.
- Optimization Strategies in FME Flow: Explore the creation and strategic deployment of parameters in FME Flow, including the use of deployment and geometry parameters, to maximize workflow efficiency.
- Pro Tips for Success: Gain insights on parameterizing connections and leveraging new features like Conditional Visibility for clarity and simplicity.
We’ll wrap up with a glimpse into future webinars, followed by a Q&A session to address your specific questions surrounding this topic.
Don’t miss this opportunity to elevate your FME expertise and drive your projects to new heights of efficiency.
GraphRAG is All You need? LLM & Knowledge GraphGuy Korland
Guy Korland, CEO and Co-founder of FalkorDB, will review two articles on the integration of language models with knowledge graphs.
1. Unifying Large Language Models and Knowledge Graphs: A Roadmap.
https://arxiv.org/abs/2306.08302
2. Microsoft Research's GraphRAG paper and a review paper on various uses of knowledge graphs:
https://www.microsoft.com/en-us/research/blog/graphrag-unlocking-llm-discovery-on-narrative-private-data/
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...DanBrown980551
Do you want to learn how to model and simulate an electrical network from scratch in under an hour?
Then welcome to this PowSyBl workshop, hosted by Rte, the French Transmission System Operator (TSO)!
During the webinar, you will discover the PowSyBl ecosystem as well as handle and study an electrical network through an interactive Python notebook.
PowSyBl is an open source project hosted by LF Energy, which offers a comprehensive set of features for electrical grid modelling and simulation. Among other advanced features, PowSyBl provides:
- A fully editable and extendable library for grid component modelling;
- Visualization tools to display your network;
- Grid simulation tools, such as power flows, security analyses (with or without remedial actions) and sensitivity analyses;
The framework is mostly written in Java, with a Python binding so that Python developers can access PowSyBl functionalities as well.
What you will learn during the webinar:
- For beginners: discover PowSyBl's functionalities through a quick general presentation and the notebook, without needing any expert coding skills;
- For advanced developers: master the skills to efficiently apply PowSyBl functionalities to your real-world scenarios.
Epistemic Interaction - tuning interfaces to provide information for AI supportAlan Dix
Paper presented at SYNERGY workshop at AVI 2024, Genoa, Italy. 3rd June 2024
https://alandix.com/academic/papers/synergy2024-epistemic/
As machine learning integrates deeper into human-computer interactions, the concept of epistemic interaction emerges, aiming to refine these interactions to enhance system adaptability. This approach encourages minor, intentional adjustments in user behaviour to enrich the data available for system learning. This paper introduces epistemic interaction within the context of human-system communication, illustrating how deliberate interaction design can improve system understanding and adaptation. Through concrete examples, we demonstrate the potential of epistemic interaction to significantly advance human-computer interaction by leveraging intuitive human communication strategies to inform system design and functionality, offering a novel pathway for enriching user-system engagements.
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf91mobiles
91mobiles recently conducted a Smart TV Buyer Insights Survey in which we asked over 3,000 respondents about the TV they own, aspects they look at on a new TV, and their TV buying preferences.
Transcript: Selling digital books in 2024: Insights from industry leaders - T...BookNet Canada
The publishing industry has been selling digital audiobooks and ebooks for over a decade and has found its groove. What’s changed? What has stayed the same? Where do we go from here? Join a group of leading sales peers from across the industry for a conversation about the lessons learned since the popularization of digital books, best practices, digital book supply chain management, and more.
Link to video recording: https://bnctechforum.ca/sessions/selling-digital-books-in-2024-insights-from-industry-leaders/
Presented by BookNet Canada on May 28, 2024, with support from the Department of Canadian Heritage.
Securing your Kubernetes cluster_ a step-by-step guide to success !KatiaHIMEUR1
Today, after several years of existence, an extremely active community and an ultra-dynamic ecosystem, Kubernetes has established itself as the de facto standard in container orchestration. Thanks to a wide range of managed services, it has never been so easy to set up a ready-to-use Kubernetes cluster.
However, this ease of use means that the subject of security in Kubernetes is often left for later, or even neglected. This exposes companies to significant risks.
In this talk, I'll show you step-by-step how to secure your Kubernetes cluster for greater peace of mind and reliability.
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...James Anderson
Effective Application Security in Software Delivery lifecycle using Deployment Firewall and DBOM
The modern software delivery process (or the CI/CD process) includes many tools, distributed teams, open-source code, and cloud platforms. Constant focus on speed to release software to market, along with the traditional slow and manual security checks has caused gaps in continuous security as an important piece in the software supply chain. Today organizations feel more susceptible to external and internal cyber threats due to the vast attack surface in their applications supply chain and the lack of end-to-end governance and risk management.
The software team must secure its software delivery process to avoid vulnerability and security breaches. This needs to be achieved with existing tool chains and without extensive rework of the delivery processes. This talk will present strategies and techniques for providing visibility into the true risk of the existing vulnerabilities, preventing the introduction of security issues in the software, resolving vulnerabilities in production environments quickly, and capturing the deployment bill of materials (DBOM).
Speakers:
Bob Boule
Robert Boule is a technology enthusiast with PASSION for technology and making things work along with a knack for helping others understand how things work. He comes with around 20 years of solution engineering experience in application security, software continuous delivery, and SaaS platforms. He is known for his dynamic presentations in CI/CD and application security integrated in software delivery lifecycle.
Gopinath Rebala
Gopinath Rebala is the CTO of OpsMx, where he has overall responsibility for the machine learning and data processing architectures for Secure Software Delivery. Gopi also has a strong connection with our customers, leading design and architecture for strategic implementations. Gopi is a frequent speaker and well-known leader in continuous delivery and integrating security into software delivery.
DevOps and Testing slides at DASA ConnectKari Kakkonen
My and Rik Marselis slides at 30.5.2024 DASA Connect conference. We discuss about what is testing, then what is agile testing and finally what is Testing in DevOps. Finally we had lovely workshop with the participants trying to find out different ways to think about quality and testing in different parts of the DevOps infinity loop.
Connector Corner: Automate dynamic content and events by pushing a buttonDianaGray10
Here is something new! In our next Connector Corner webinar, we will demonstrate how you can use a single workflow to:
Create a campaign using Mailchimp with merge tags/fields
Send an interactive Slack channel message (using buttons)
Have the message received by managers and peers along with a test email for review
But there’s more:
In a second workflow supporting the same use case, you’ll see:
Your campaign sent to target colleagues for approval
If the “Approve” button is clicked, a Jira/Zendesk ticket is created for the marketing design team
But—if the “Reject” button is pushed, colleagues will be alerted via Slack message
Join us to learn more about this new, human-in-the-loop capability, brought to you by Integration Service connectors.
And...
Speakers:
Akshay Agnihotri, Product Manager
Charlie Greenberg, Host
2. TOPICS
• Reactor Pattern / Actor Model revisited
• Celluloid
• Celluloid::IO
• DCell
• Reel
• #TODO
Monday, July 15, 13
3. REACTOR PATTERN REVISITED
• Event Handling for concurrent requests
• Multiplex
• X inputs are combined to a single channel
• Demultiplex
• Single channel is converted to X inputs
• Aka Synchronous Event Loop
Monday, July 15, 13
4. REACTOR PATTERN REVISITED
• Dispatcher
• Dispatch resources from Demultiplexer to related request
handler
• Request Handler
• An app that handles request
Monday, July 15, 13
5. ACTOR MODEL REVISITED
• Carl Hewitt paper from 1973
• Mathematical model of Concurrent Computation
• Known first languages:
• Cosmic Cube
• J-Machine
• Most popular implementation: Erlang
Monday, July 15, 13
6. ACTOR MODEL REVISITED
• Actor is a entity that interact with other actors sending /
receiving messages (mailbox)
• Each actor runs as a independent process
• No shared state
Monday, July 15, 13
7. CELLULOID
• Ruby Actor Model implementation
• Created byTony Arcieri - @bascule
• Need Fibers support
• MRI 1.9
• Rubinius / JRuby with 1.9 mode enabled
• Use. Only.Thread. Safe. Libs. For.Your. Sanity.
• Heavily inspired on Erlang concurrency approach
Monday, July 15, 13
8. CELLULOID
• Automatic Synchronization
• Don’t worry with semaphores / mutex, Celluloid manages :)
• Remember: each actor runs in a thread
• Method dispatch using Fibers
• If method call other actors, Fiber is suspended until call chain
returns something
• Example: I/O waiting
Monday, July 15, 13
9. CELLULOID
# -*- encoding: UTF-8 -*-
require 'celluloid'
class FredFlinstone
include Celluloid
def scream(to)
@scream = "#{to}#{to[-1] * 10}"
@screamed_at = Time.now
end
def resume
"Screamed [#{@scream}] at #{@screamed_at}"
end
end
Monday, July 15, 13
10. CELLULOID
irb(main):001:0> fred = FredFlinstone.new
=> #<Celluloid::ActorProxy(FredFlinstone:0x9cd7cc)>
irb(main):002:0> fred.async.scream "Wilma"
=> nil
irb(main):003:0> fred.resume
=> "Screamed [Wilmaaaaaaaaaaa] at 2013-07-10 23:01:29 -0300"
Monday, July 15, 13
11. CELLULOID
• Fault-tolerance
• Erlang philosophy: let it crash
• Celluloid handles crashed actors with these mechanisms:
• Supervisors
• Supervision groups
• Linking
Monday, July 15, 13
12. CELLULOID
• Supervisors
• How actors crash? Simple: unhandled exceptions
• Warning #1: async calls that raises an error crashes the message
receiver; posterior calls NOT RAISES ANYTHING.
• Warning #2: actors spawns a nativeThread, that are not
automatically cleaned by GC; you *must* explicitly terminate
them if not crashed.
• Supervise to the rescue
Monday, July 15, 13
13. CELLULOID
# -*- encoding: UTF-8 -*-
require 'celluloid'
class Devops
include Celluloid
def initialize(name)
@name = name
end
def up_to_no_good
@bad_cmd = 'rm-f /'
@command = `#{@bad_cmd}`,
@executed_at = Time.now
end
end
Monday, July 15, 13
15. CELLULOID
• Supervision Groups
• Supervise many actors at once
• Able to supervise other groups too
• You can create pools of supervised actors
• Transparent GC cleaning (automatic terminate all supervised
actors)
Monday, July 15, 13
16. CELLULOID
# -*- encoding: UTF-8 -*-
require 'celluloid'
class EyeOfSauron < Celluloid::SupervisionGroup
supervise FredFlinstone, as: :fred
pool Devops, as: :devops_pool
end
Monday, July 15, 13
18. CELLULOID
• Linking
• Suppose that you have two interdependent actors and want
to be notified if one fails
• Association by linking actor that commonly dies and the
receiver enables a simple callback when failure occurs
• Very useful to terminate broken actors manually
Monday, July 15, 13
19. CELLULOID
# -*- encoding: UTF-8 -*-
require 'celluloid'
class RobertoBaggio
include Celluloid
class KickedFarAwayError < StandardError; end
def kick_penalty
raise KickedFarAwayError, "OH MAMMA MIA! :'("
end
end
Monday, July 15, 13
20. CELLULOID
# -*- encoding: UTF-8 -*-
require 'celluloid'
class GalvaoBueno
include Celluloid
trap_exit :penalty_kick
def penalty_kick(player, reason)
puts "#{player.inspect} will kick and... #{reason.class}!"
2.times { puts "ACABOOOOOOU! "; sleep(1) }
3.times { puts "EH TETRAAAA! "; sleep(1) }
end
end
Monday, July 15, 13
22. CELLULOID
• Futures
• Kind of lazy computation: request a future on method call
and only execute it when needed
• When value is required, Celluloid internal threadpool
executes method synchronously and returns the result
• Transparent error raising
• No need to explicitly clean up pool, let GC work
Monday, July 15, 13
23. CELLULOID
# -*- encoding: UTF-8 -*-
require 'celluloid'
require 'restclient'
class LazyConsumer
include Celluloid
def retrieve
RestClient.get('http://www.locaweb.com.br').body
end
end
Monday, July 15, 13
25. CELLULOID
• Pools
• You can define a pool of actors (ORLY?);
• Default size: cores available on machine (Celluloid.cores)
• Delegates method call to a worker on pool to execute it
• Not sooo great due for GIL on MRI, but is OK when you have async I/O :)
• Main tips:
• Synchronous calls if concurrent access to a resource (via Actor.<#method> or
Actor.future.<#method>)
• Asynchronous calls if parallel computation (via Actor.async.<#method>)
Monday, July 15, 13
26. CELLULOID
# -*- encoding: UTF-8 -*-
require 'celluloid'
require 'restclient'
class LazyConsumer
include Celluloid
def retrieve
RestClient.get('http://www.locaweb.com.br').body
end
end
Monday, July 15, 13
28. CELLULOID::IO
• Celluloid plus Evented I/O = Celluloid::IO
• Celluloid with steroids =P
• Uses nio4r (libev native extension) as a Reactor to manage
Celluloid Actor Mailboxes
• Great with most-idle connections (sockets, websockets and
friends)
• Multiplex message processing and I/O in a transparent way
Monday, July 15, 13
30. CELLULOID::IO
# -*- encoding: UTF-8 -*-
require 'celluloid/io'
class WhoisServer
include Celluloid::IO
def initialize(host, port)
@server = TCPServer.new host, port
end
def start ; run ; end
def stop ; @server.close if @server ; end
def run ; loop { async.handle_connection @server.accept } ; end
def handle_connection(socket)
_, port, host = socket.peeraddr
domain_id = socket.read.strip
socket.write("I received a query to #{domain_id} at #{Time.now}n")
ensure
socket.close
end
end
Monday, July 15, 13
31. CELLULOID::IO
irb(main):001:0> ws = WhoisServer.new '0.0.0.0', 4343
=> #<Celluloid::ActorProxy(WhoisServer:0xa2f404)
@server=#<Celluloid::IO::TCPServer:0x00000001652358 @server=#<TCPServer:fd 10>>>
irb(main):002:0> ws.async.start
=> nil
vagrant@vagrant-debian-wheezy:~$ whois -h localhost -p 4343 xalala.com.br
I received a query to xelele.com.br at 2013-07-11 01:00:17 -0300
vagrant@vagrant-debian-wheezy:~$ whois -h localhost -p 4343 xirubiru.com.br
I received a query to xirubiru.com.br at 2013-07-11 01:01:09 -0300
Monday, July 15, 13
32. DCELL
• Distributed Ruby (wat) objects as network services
• DCell != DRb (Distributed Ruby)
• DRb comes with Ruby STDLIB
• Ruby specific, not interoperatable with CORBA, RMI, etc
• DCell is built on top of Celluloid::ZMQ
• ØMQ protocol implementation with Celluloid Actors
Monday, July 15, 13
33. DCELL
# -*- encoding: UTF-8 -*-
# example from https://github.com/celluloid/dcell :)
require 'dcell'
DCell.start id: 'itchy', addr: 'tcp://127.0.0.1:9001'
class Itchy
include Celluloid
def initialize
puts "Ready for mayhem!"
@n = 0
end
def fight
@n = (@n % 6) + 1
puts(@n <= 3 ? "Bite!" : "Fight!")
end
end
Itchy.supervise_as :itchy ; sleep
Monday, July 15, 13
34. DCELL
# -*- encoding: UTF-8 -*-
# example from https://github.com/celluloid/dcell :)
require 'dcell'
DCell.start id: 'scratchy', addr: 'tcp://127.0.0.1:9002'
itchy_node = DCell::Node['itchy']
puts "Fighting itchy! (check itchy's output)"
6.times do
itchy_node[:itchy].fight
sleep 1
end
Monday, July 15, 13
35. REEL
• Celluloid::IO web server powered
• Similar syntax to EventMachine
• And, of course, weird and potentially ugly after some time
• Rack support is experimental
• Good with websockets
• Not so fast:
• Goliath < Reel <<<<Thin <<< Node.js
Monday, July 15, 13
36. REEL
• Let’s show code from https://github.com/salizzar/reel-example
Monday, July 15, 13
37. #TODO
• Great opportunity to create a DCell similar gem using AMQP
• Stable Rack support for Reel
• Not sure, low usage at this time
• Other wrappers are welcome
• Celluloid::Redis is a great example
• Celluloid wrap != EventMachine wrap
• Use Dependency Injection API (if possible) to wrap sockets with
Celluloid::IO instead of STDLIB sockets
Monday, July 15, 13