A document about queues discusses what queues are, why they are used, common use cases, implementation patterns, protocols, considerations when implementing queues, and how to handle issues that may arise. Queues act as buffers that allow different applications or systems to communicate asynchronously by passing messages. They help decouple components, distribute load, and improve reliability and user experience. Common examples of messages that may be queued include emails, images, videos, and IoT data.
Behind the Scenes at LiveJournal: Scaling StorytimeSergeyChernyshev
Brad talks about clustering setups using MySQL and DRDB and their Open Source software most of which he wrote initially and continues to develop.
A lot of these techniques and/or software is used by many other companies as well - among them Flickr/Yahoo! and Facebook.
Integrating multiple CDN providers at Etsy - Velocity Europe (London) 2013Marcus Barczak
Relying on a single content delivery network for your site can impose a number of flexibility limitations. By diversifying your CDN providers you can put the power back in your hands, allowing you to get the best of both worlds in terms of performance, reliability and cost. In this talk Marcus and Laurie will present Etsy’s recent work integrating multiple CDN providers to their site delivery infrastructure.
This presentation was delivered at Velocity Europe, November 2013
With the Varnish caching proxy you can make websites blazingly fast. The basics are quite simple once you understand how cache handling in HTTP works. For starters, we will look into HTTP and Varnish configuration. The main course is going to be test-driven cache invalidation and the cache tagging strategy. For desserts, there will be an introduction to Edge Side Includes (ESI). All of this will be liberally sprinkled with examples from the FOSHttpCache library and some ideas from the FOSHttpCacheBundle for Symfony2.
This presentation explains how to deploy and use the Integrated Caching feature on Netscaler. I gave this presentation to Citrix staff, customers and partners in worldwide in 2011. The presentation covers best practices and gotchas :) Integrated Caching is an excellent feature that can greatly improve the performance of your website.
Behind the Scenes at LiveJournal: Scaling StorytimeSergeyChernyshev
Brad talks about clustering setups using MySQL and DRDB and their Open Source software most of which he wrote initially and continues to develop.
A lot of these techniques and/or software is used by many other companies as well - among them Flickr/Yahoo! and Facebook.
Integrating multiple CDN providers at Etsy - Velocity Europe (London) 2013Marcus Barczak
Relying on a single content delivery network for your site can impose a number of flexibility limitations. By diversifying your CDN providers you can put the power back in your hands, allowing you to get the best of both worlds in terms of performance, reliability and cost. In this talk Marcus and Laurie will present Etsy’s recent work integrating multiple CDN providers to their site delivery infrastructure.
This presentation was delivered at Velocity Europe, November 2013
With the Varnish caching proxy you can make websites blazingly fast. The basics are quite simple once you understand how cache handling in HTTP works. For starters, we will look into HTTP and Varnish configuration. The main course is going to be test-driven cache invalidation and the cache tagging strategy. For desserts, there will be an introduction to Edge Side Includes (ESI). All of this will be liberally sprinkled with examples from the FOSHttpCache library and some ideas from the FOSHttpCacheBundle for Symfony2.
This presentation explains how to deploy and use the Integrated Caching feature on Netscaler. I gave this presentation to Citrix staff, customers and partners in worldwide in 2011. The presentation covers best practices and gotchas :) Integrated Caching is an excellent feature that can greatly improve the performance of your website.
(NET308) Consolidating DNS Data in the Cloud with Amazon Route 53Amazon Web Services
In this session, we show you how to use Amazon Route 53 to consolidate your DNS data and manage it centrally. Learn how to use Amazon Route 53 for public DNS and for private DNS in VPC, and also learn how to combine Amazon Route 53 private DNS with your own DNS infrastructure.
Caching the uncacheable with Varnish - DevDays 2021Thijs Feryn
Slides for my "Caching the uncacheable with Varnish" presentation at DevDays 2021. See https://feryn.eu/speaking/caching-uncacheable-varnish-devdays-2021/ for more information
Improving Website Performance with Memecached Webinar | Achieve InternetAchieve Internet
Improving the performance and scalability of your Drupal website with a Memcached implementation.
In this webinar, you will learn about:
• The components of a Memcached system
• Installing a simple Memcached installation
• Complex distributed installations and when to use them
• Verifying the installation
William Brander and Sean Farmar show how the monitoring game changes when a system becomes distributed and you start delving into the world of microservices.
Learn:
* Why monitoring changes in distributed systems
* A monitoring philosophy that ensures all bases are covered
* The aspects of monitoring that affect asynchronous messaging systems
Stupid Boot Tricks: using ipxe and chef to get to boot management blissmacslide
In this talk I will cover how I built a boot system using ipxe and chef's api to create a lightweight tool for managing install and firmware updating of hosts and network gear.
Memcached: What is it and what does it do?Brian Moon
Memcached has become the de facto standard for caching web applications. But, many users jump in feet first without understanding what it does or perhaps more importantly what it does not do. Once you understand memcached, you may come to realize that it is what it does not do that makes it so good.
Memcached is a distributed memory based caching system. But, what does that mean for you? This session will cover the basics of memcached. What are all the components needed? Where is your data cached? What happens when there is a system failure? Is my data stored in more than one place? How do I know what is in my cache? All these questions and more will be answered.
Tips for going fast in a slow world: Michael May at OSCON 2015Fastly
Fastly engineer Michael May at OSCON 2015: When it comes to caching, we fall into two categories – those who make phat stacks of cache money and those who suffer from cache anxiety. We know caching aggressively improves performance; however, advanced caching strategies for event-driven content or user-specific content are often neglected for fear of complexity or lack of understanding. In this talk, we’ll cover HTTP caching, old and new strategies for caching historically ‘uncacheable’ content, and secret features of HTTP accelerators like Varnish. Whether you’re already stacking cache or just seeking a prescription for one, you’ll leave with a deeper understanding of caching and accelerating applications that you can take and apply to your Rails, Django, etc. apps.
(NET308) Consolidating DNS Data in the Cloud with Amazon Route 53Amazon Web Services
In this session, we show you how to use Amazon Route 53 to consolidate your DNS data and manage it centrally. Learn how to use Amazon Route 53 for public DNS and for private DNS in VPC, and also learn how to combine Amazon Route 53 private DNS with your own DNS infrastructure.
Caching the uncacheable with Varnish - DevDays 2021Thijs Feryn
Slides for my "Caching the uncacheable with Varnish" presentation at DevDays 2021. See https://feryn.eu/speaking/caching-uncacheable-varnish-devdays-2021/ for more information
Improving Website Performance with Memecached Webinar | Achieve InternetAchieve Internet
Improving the performance and scalability of your Drupal website with a Memcached implementation.
In this webinar, you will learn about:
• The components of a Memcached system
• Installing a simple Memcached installation
• Complex distributed installations and when to use them
• Verifying the installation
William Brander and Sean Farmar show how the monitoring game changes when a system becomes distributed and you start delving into the world of microservices.
Learn:
* Why monitoring changes in distributed systems
* A monitoring philosophy that ensures all bases are covered
* The aspects of monitoring that affect asynchronous messaging systems
Stupid Boot Tricks: using ipxe and chef to get to boot management blissmacslide
In this talk I will cover how I built a boot system using ipxe and chef's api to create a lightweight tool for managing install and firmware updating of hosts and network gear.
Memcached: What is it and what does it do?Brian Moon
Memcached has become the de facto standard for caching web applications. But, many users jump in feet first without understanding what it does or perhaps more importantly what it does not do. Once you understand memcached, you may come to realize that it is what it does not do that makes it so good.
Memcached is a distributed memory based caching system. But, what does that mean for you? This session will cover the basics of memcached. What are all the components needed? Where is your data cached? What happens when there is a system failure? Is my data stored in more than one place? How do I know what is in my cache? All these questions and more will be answered.
Tips for going fast in a slow world: Michael May at OSCON 2015Fastly
Fastly engineer Michael May at OSCON 2015: When it comes to caching, we fall into two categories – those who make phat stacks of cache money and those who suffer from cache anxiety. We know caching aggressively improves performance; however, advanced caching strategies for event-driven content or user-specific content are often neglected for fear of complexity or lack of understanding. In this talk, we’ll cover HTTP caching, old and new strategies for caching historically ‘uncacheable’ content, and secret features of HTTP accelerators like Varnish. Whether you’re already stacking cache or just seeking a prescription for one, you’ll leave with a deeper understanding of caching and accelerating applications that you can take and apply to your Rails, Django, etc. apps.
people hacking: opensource biz etiquettesarahnovotny
Do you obsess when writing emails to "business people" or feel awkward and not know how to converse with "finance people"? Dread networking events? Understanding the biases that our audience have and being empathetic to their goals will smooth any interaction. Open source projects present unique business challenges since so many of our staffing resources are volunteer. Easy interactions and good business happen when common interests are highlighted and shared goals are defined. Let's cut through posturing and adversarial language and practice hacking people to align interests and improve everyone's comfort in business situations. The fantastic side effect of this is that your project and business become more inclusive and stronger through diversity of background, skills and perspectives.
Wikipedia: A Tool for Teaching (Skeptical) Research Elizabeth Nesius
Wikipedia is one form of social media, and often at the bull’s eye of “new media myopia” (Obar, 2012). When asked to do research, Wikipedia is usually the first place students look. While we might want to teach students that Wikipedia is one place to start, it usually is not the one place where we want them to end. Therefore, incorporating Wikipedia into classroom instruction is a powerful way to teach students how to analyze the sources they use. This presentation will introduce educators to possible ways Wikipedia can be utilized in the classroom as a teaching and learning tool.
This workshop is a hands-on training where a real Zend Framework application is used as an example to start improving QA using tools to test, document and perform software metric calculations to indicate where the software can be improved. I also explain the reports produced by a CI system.
The quest for global design principles (SymfonyLive Berlin 2015)Matthias Noback
If you’re a programmer you make design decisions every second. You need to think, and often think hard, about everything. Luckily there are many useful design principles and patterns that you can apply. But some of them merely expose code smells. Others only help you design your classes. And some are applicable to packages only. Wouldn’t it be nice to have some more general, always useful, invariably applicable, foundational design principles? In this talk we’ll look at software from many different perspectives, and while we’re zooming in and out, we’ll discover some of the deeper principles that form the basis of proper object-oriented design. After attending this talk you will be able to make better design decisions by reflecting on the stream of messages that is flowing from object to object, and from application to application.
Presented at EmberConf 2015 by @sugarpirate_
In the dark ages of web development, designing a beautiful user experience meant having to constantly fight with the DOM to get it to do what you want, when you want. With Ember, we no longer have to struggle with managing DOM state, and we are free to put the user experience first with reactive UI.
In this talk, we'll discuss the ways in which Ember makes it easy to build delightful and reactive user experiences, and how you can build reusable components that even non-technical designers can learn to use. Learn about the thoughtful touches and interactions you can add to an Ember app.
Links:
1. Computed property macro demo – http://emberjs.jsbin.com/vubaga/11/edit?js,output
2. Showerthoughts loading messages demo – http://emberjs.jsbin.com/lulaki/35/edit?js,output
3. Flash messages demo – http://emberjs.jsbin.com/ranewo/45/edit?js,output
4. Drag and drop demo – http://emberjs.jsbin.com/denep/18/edit?js,output
"As an asynchronous event driven JavaScript runtime, Node is designed to build scalable network applications" così si presenta Node.js, piattaforma tecnologica che - grazie alla sua immediatezza e produttività - ha conquistato dapprima startup e piccole aziende, fino a ritagliarsi uno spazio importante in realtà come IBM, LinkedIn, Netflix e Yahoo. La stessa Microsoft ha riconosciuto le potenzialità della piattaforma, tanto da integrare Node.js in Visual Studio Code e nelle ultime release di Visual Studio, oltre a basarci alcuni dei propri servizi di Azure come "Mobile Services" e "Functions".
In questa sessione vedremo come implementare con Node.js alcuni scenari applicativi comuni nell’ambito dello sviluppo web, analizzando quando la sua adozione può portarci vantaggi nel nostro lavoro quotidiano. In conclusione, faremo una breve panoramica architetturale, descrivendo alcuni scenari di cooperazione tra .NET e Node.js nello stesso sistema.
Codice e demo: https://github.com/rucka/CommunityDays2016
Slides from presentation: "Revoke-Obfuscation: PowerShell Obfuscation Detection (And Evasion) Using Science" originally released at Black Hat USA 2017 & DEF CON by @danielhbohannon and @Lee_Holmes.
For more information: http://www.danielbohannon.com/presentations/
Supercharging WordPress Development - Wordcamp Brighton 2019Adam Tomat
Slide links:
- https://lumberjack.rareloop.com
- https://docs.lumberjack.rareloop.com
- https://github.com/Rareloop/lumberjack-bedrock-installer
- https://github.com/Rareloop/lumberjack
- https://github.com/Rareloop/lumberjack-validation
- https://github.com/Rareloop/hatchet
- rareloop.com/careers
- https://www.rareloop.com/posts/comparing-modern-mvc-wordpress-frameworks/
- https://lizkeogh.com/2017/08/31/reflecting-reality/amp
- https://www.youtube.com/watch?v=uQUxJObxTUs
- https://www.upstatement.com/timber
- https://roots.io/bedrock
---
Often WordPress themes are not easy to change, maintain or fun to work on. This can rule WordPress out as a viable option for bespoke, non-trivial websites.
In this talk we’ll dive into how this happens & look at how we can benefit from software engineering techniques to help make your code easier to change. I’ll also show how using Lumberjack, a powerful MVC framework built on Timber, can be used to power-up your themes.
ZF2 takes a different approach to services; there are several services out there and you should be providing the ability for ZF2 to integrate with this. ZF2 marries services with composer and a different packaging mechanism to ensure that services can be released without a specific framework version. This not only helps the framework but helps you prevent an API changing in between framework releases without having an issue of awaiting a framework release.
Presentation on sending push notifications with Zend Framework based on work to create Zend_Mobile_Push. Currently handles APNs (iPhone/iPad/iTouch), C2DM (Android) and MPNS (Windows Mobile). Additionally mentions of sending push notifications with WAP PAP (BlackBerry).
Mobile: for push and sync. Goes through implementing push notifications with PHP on the various 4 major players: Android (C2DM), Apple (APNS), Windows Phone (MPNS), BlackBerry (maybe works?).
So, you know how to deploy your code, what about your database? This talk will go through deploying your database with LiquiBase and DBDeploy a non-framework based approach to handling migrations of DDL and DML.
PHP Frameworks: I want to break free (IPC Berlin 2024)Ralf Eggert
In this presentation, we examine the challenges and limitations of relying too heavily on PHP frameworks in web development. We discuss the history of PHP and its frameworks to understand how this dependence has evolved. The focus will be on providing concrete tips and strategies to reduce reliance on these frameworks, based on real-world examples and practical considerations. The goal is to equip developers with the skills and knowledge to create more flexible and future-proof web applications. We'll explore the importance of maintaining autonomy in a rapidly changing tech landscape and how to make informed decisions in PHP development.
This talk is aimed at encouraging a more independent approach to using PHP frameworks, moving towards a more flexible and future-proof approach to PHP development.
UiPath Test Automation using UiPath Test Suite series, part 4DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 4. In this session, we will cover Test Manager overview along with SAP heatmap.
The UiPath Test Manager overview with SAP heatmap webinar offers a concise yet comprehensive exploration of the role of a Test Manager within SAP environments, coupled with the utilization of heatmaps for effective testing strategies.
Participants will gain insights into the responsibilities, challenges, and best practices associated with test management in SAP projects. Additionally, the webinar delves into the significance of heatmaps as a visual aid for identifying testing priorities, areas of risk, and resource allocation within SAP landscapes. Through this session, attendees can expect to enhance their understanding of test management principles while learning practical approaches to optimize testing processes in SAP environments using heatmap visualization techniques
What will you get from this session?
1. Insights into SAP testing best practices
2. Heatmap utilization for testing
3. Optimization of testing processes
4. Demo
Topics covered:
Execution from the test manager
Orchestrator execution result
Defect reporting
SAP heatmap example with demo
Speaker:
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
Essentials of Automations: The Art of Triggers and Actions in FMESafe Software
In this second installment of our Essentials of Automations webinar series, we’ll explore the landscape of triggers and actions, guiding you through the nuances of authoring and adapting workspaces for seamless automations. Gain an understanding of the full spectrum of triggers and actions available in FME, empowering you to enhance your workspaces for efficient automation.
We’ll kick things off by showcasing the most commonly used event-based triggers, introducing you to various automation workflows like manual triggers, schedules, directory watchers, and more. Plus, see how these elements play out in real scenarios.
Whether you’re tweaking your current setup or building from the ground up, this session will arm you with the tools and insights needed to transform your FME usage into a powerhouse of productivity. Join us to discover effective strategies that simplify complex processes, enhancing your productivity and transforming your data management practices with FME. Let’s turn complexity into clarity and make your workspaces work wonders!
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.
The Metaverse and AI: how can decision-makers harness the Metaverse for their...Jen Stirrup
The Metaverse is popularized in science fiction, and now it is becoming closer to being a part of our daily lives through the use of social media and shopping companies. How can businesses survive in a world where Artificial Intelligence is becoming the present as well as the future of technology, and how does the Metaverse fit into business strategy when futurist ideas are developing into reality at accelerated rates? How do we do this when our data isn't up to scratch? How can we move towards success with our data so we are set up for the Metaverse when it arrives?
How can you help your company evolve, adapt, and succeed using Artificial Intelligence and the Metaverse to stay ahead of the competition? What are the potential issues, complications, and benefits that these technologies could bring to us and our organizations? In this session, Jen Stirrup will explain how to start thinking about these technologies as an organisation.
Climate Impact of Software Testing at Nordic Testing DaysKari Kakkonen
My slides at Nordic Testing Days 6.6.2024
Climate impact / sustainability of software testing discussed on the talk. ICT and testing must carry their part of global responsibility to help with the climat warming. We can minimize the carbon footprint but we can also have a carbon handprint, a positive impact on the climate. Quality characteristics can be added with sustainability, and then measured continuously. Test environments can be used less, and in smaller scale and on demand. Test techniques can be used in optimizing or minimizing number of tests. Test automation can be used to speed up testing.
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.
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...SOFTTECHHUB
The choice of an operating system plays a pivotal role in shaping our computing experience. For decades, Microsoft's Windows has dominated the market, offering a familiar and widely adopted platform for personal and professional use. However, as technological advancements continue to push the boundaries of innovation, alternative operating systems have emerged, challenging the status quo and offering users a fresh perspective on computing.
One such alternative that has garnered significant attention and acclaim is Nitrux Linux 3.5.0, a sleek, powerful, and user-friendly Linux distribution that promises to redefine the way we interact with our devices. With its focus on performance, security, and customization, Nitrux Linux presents a compelling case for those seeking to break free from the constraints of proprietary software and embrace the freedom and flexibility of open-source computing.
In his public lecture, Christian Timmerer provides insights into the fascinating history of video streaming, starting from its humble beginnings before YouTube to the groundbreaking technologies that now dominate platforms like Netflix and ORF ON. Timmerer also presents provocative contributions of his own that have significantly influenced the industry. He concludes by looking at future challenges and invites the audience to join in a discussion.
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfPaige Cruz
Monitoring and observability aren’t traditionally found in software curriculums and many of us cobble this knowledge together from whatever vendor or ecosystem we were first introduced to and whatever is a part of your current company’s observability stack.
While the dev and ops silo continues to crumble….many organizations still relegate monitoring & observability as the purview of ops, infra and SRE teams. This is a mistake - achieving a highly observable system requires collaboration up and down the stack.
I, a former op, would like to extend an invitation to all application developers to join the observability party will share these foundational concepts to build on:
Removing Uninteresting Bytes in Software FuzzingAftab Hussain
Imagine a world where software fuzzing, the process of mutating bytes in test seeds to uncover hidden and erroneous program behaviors, becomes faster and more effective. A lot depends on the initial seeds, which can significantly dictate the trajectory of a fuzzing campaign, particularly in terms of how long it takes to uncover interesting behaviour in your code. We introduce DIAR, a technique designed to speedup fuzzing campaigns by pinpointing and eliminating those uninteresting bytes in the seeds. Picture this: instead of wasting valuable resources on meaningless mutations in large, bloated seeds, DIAR removes the unnecessary bytes, streamlining the entire process.
In this work, we equipped AFL, a popular fuzzer, with DIAR and examined two critical Linux libraries -- Libxml's xmllint, a tool for parsing xml documents, and Binutil's readelf, an essential debugging and security analysis command-line tool used to display detailed information about ELF (Executable and Linkable Format). Our preliminary results show that AFL+DIAR does not only discover new paths more quickly but also achieves higher coverage overall. This work thus showcases how starting with lean and optimized seeds can lead to faster, more comprehensive fuzzing campaigns -- and DIAR helps you find such seeds.
- These are slides of the talk given at IEEE International Conference on Software Testing Verification and Validation Workshop, ICSTW 2022.
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.
25. AMQP
• AMQP Working Group
(Community andVendor)
• Platform agnostic protocol.
• Completely open,
interoperable and broadly
applicable.
• Many severs available and
many client libraries.
26.
27. STOMP
• Simple protocol
• Behaviors follow very
simple commands.
• Most message queues can
communicate over STOMP.
53. WORKER CONSIDERATIONS
• Should do ONE thing and
ONE thing well.
• Should attempt to be as
quick as possible in handling
that type.
• Should be able to be scaled
horizontally.
56. <?php
interface QueueInterface {
public function __construct(Stomp $stomp, $queue);
public function dispatch();
public function publish(array $message);
public function work(StompFrame $message);
}
57. <?php
class AbstractQueue implements QueueInterface {
protected $stomp;
protected $queue;
protected $signal;
public function __construct(Stomp $stomp, $queue) {
$this->stomp = $stomp;
$this->queue = $queue;
}
protected function prepare() {
if (php_sapi_name() != 'cli') {
throw new RuntimeException('You cannot dispatch outside of the CLI');
}
if (function_exists('pcntl_signal')) {
pcntl_signal(SIGTERM, array($this, 'signal'));
pcntl_signal(SIGINT, array($this, 'signal'));
pcntl_signal(SIGHUP, array($this, 'signal'));
}
}
protected function signal($signal) {
$this->signal = $signal;
}
58. public function dispatch() {
$this->prepare();
while (true) {
if ($this->signal) {
break ;
}
if (!$this->stomp->hasFrame()) {
$this->wait();
continue ;
}
$frame = $this->stomp->readFrame();
if ($this->validate($frame)) {
$this->work($frame);
}
$this->stomp->ack($frame);
}
}
protected function wait() {
sleep(1);
}
protected function validate(StompFrame $message) {
return false;
}
public function publish(array $message) {
return $this->stomp->send($this->queue, json_encode($message));
}
59. <?php
class EmailQueue extends AbstractQueue {
public function validate(StompFrame $message) {
if (!array_key_exists('to', $message)) {
return false;
}
return true;
}
public function work(StompFrame $message) {
$mail = json_decode($message);
mail($mail->to, $mail->subject, $mail->message);
}
}
69. EXAMPLE PROGRAM
CONFIGURATION
[program:emailworker]
command=/usr/bin/php /var/www/worker "MyProjectQueueEmail"
process_name=%(program_name)s_%(process_num)d
numprocs=2
numprocs_start=2
user=www-data
autostart=true ; start at supervisord start (default: true)
autorestart=true ; retstart at unexpected quit (default: true)
startsecs=10 ; number of secs prog must stay running (def. 10)
startretries=5 ; max # of serial start failures (default 3)
log_stdout=true ; if true, log program stdout (default true)
log_stderr=true ; if true, log program stderr (def false)
redirect_stderr=true ; if true, redirect stderr to stdout
stdout_logfile=/var/www/logs/worker-panoramaqueuekrpano.log
stdout_logfile_maxbytes=10MB
stdout_logfile_backups=15