SlideShare a Scribd company logo
¡ActionHero al rescate!
ActionHeroJS Talk
Estructura del Proyecto
.
├── actions
├── bin
├── config
├── initializers
├── locales
├── log
├── node_modules
├── package.json
├── pids
├── public
├── README.md
├── servers
├── tasks
└── test
Las entidades principales como acciones, inicializadores o tareas se pueden generar
usando el comando de actionhero
npm run actionhero generate action -- --name=myFirstAction
HTTP
WebSockets
TCP
ActionHeroJS Talk
'use strict'
// npm run actionhero generate action -- --name=myFirstAction
exports.action = {
name: 'myFirstAction',
description: 'an actionhero action',
blockedConnectionTypes: [],
outputExample: {},
matchExtensionMimeType: false,
version: 1.0,
toDocument: true,
middleware: [],
inputs: {},
run: function (api, data, next) {
let error = null
// your logic here
return next(error)
}
}
Acciones
data = {
connection: connection,
action: 'randomNumber',
toProcess: true,
toRender: true,
messageCount: 123,
params: {
action: 'randomNumber',
apiVersion: 1
},
actionStartTime: 123,
response: {},
}
ActionHeroJS Talk
'use strict'
// npm run actionhero generate task -- 
// --name=myFirstTask --queue=default --frequency=0
exports.task = {
name: 'myFirstTask',
description: 'an actionhero task',
frequency: 0,
queue: 'default',
middleware: [],
plugins: [],
run: function (api, params, next) {
// your logic here
// let error = new Error('something has gone wrong')
// let resultLogMessage = {taskResult: 'ok'}
// next(error, resultLogMessage)
return next()
}
}
Tareas
'use strict'
// npm run actionhero generate initializer -- --name=myFirstInitializer
module.exports = {
loadPriority: 1000,
startPriority: 1000,
stopPriority: 1000,
initialize: function (api, next) {
api.myFirstInitializer = {}
return next()
},
start: function (api, next) {
return next()
},
stop: function (api, next) {
return next()
}
}
Inicializadores
Action Cluster
● Cache
○ Get/Set
○ Listas
○ Bloqueos
● RPC
● Conexiones
● Pub/Sub
api.connections.apply('abc123', 'set', ['auth', true],
function(error, connectionDetails){
// do stuff
});

More Related Content

What's hot (20)

PDF
Monitoring with Syslog and EventMachine (RailswayConf 2012)
Wooga
 
PPTX
Boot strap.groovy
Vijay Shukla
 
PDF
A Gentle Introduction to Event Loops
deepfountainconsulting
 
PPTX
Caching and invalidating with managed store
irfan1008
 
ODP
Anyevent
Marian Marinov
 
PDF
Puppet Camp Ghent 2013
Server Density
 
PDF
わかった気になるgitit-0.8
Kiwamu Okabe
 
PDF
clara-rules
Ikuru Kanuma
 
PDF
Javascript Continues Integration in Jenkins with AngularJS
Ladislav Prskavec
 
PDF
livedoor blogのsorryサーバの話 #study2study
SATOSHI TAGOMORI
 
PPTX
Perl: Coro asynchronous
Shmuel Fomberg
 
KEY
Offline Application Cache
Jonathan Stark
 
KEY
Study2study#4 nginx conf_1_24
Naoya Nakazawa
 
PPT
Assurer - a pluggable server testing/monitoring framework
Gosuke Miyashita
 
PDF
톰캣 #04-환경설정
GyuSeok Lee
 
KEY
Time tested php with libtimemachine
Nick Galbreath
 
PDF
SambaStatus a "Do it yourself" module for NethServer
NethServer
 
PDF
Debugging in Clojure: Finding Light in the Darkness using Emacs and Cursive
Ahmad Ragab
 
ODP
nginx mod PSGI
Yaroslav Korshak
 
RTF
RegistryModClass
John Zamoider
 
Monitoring with Syslog and EventMachine (RailswayConf 2012)
Wooga
 
Boot strap.groovy
Vijay Shukla
 
A Gentle Introduction to Event Loops
deepfountainconsulting
 
Caching and invalidating with managed store
irfan1008
 
Anyevent
Marian Marinov
 
Puppet Camp Ghent 2013
Server Density
 
わかった気になるgitit-0.8
Kiwamu Okabe
 
clara-rules
Ikuru Kanuma
 
Javascript Continues Integration in Jenkins with AngularJS
Ladislav Prskavec
 
livedoor blogのsorryサーバの話 #study2study
SATOSHI TAGOMORI
 
Perl: Coro asynchronous
Shmuel Fomberg
 
Offline Application Cache
Jonathan Stark
 
Study2study#4 nginx conf_1_24
Naoya Nakazawa
 
Assurer - a pluggable server testing/monitoring framework
Gosuke Miyashita
 
톰캣 #04-환경설정
GyuSeok Lee
 
Time tested php with libtimemachine
Nick Galbreath
 
SambaStatus a "Do it yourself" module for NethServer
NethServer
 
Debugging in Clojure: Finding Light in the Darkness using Emacs and Cursive
Ahmad Ragab
 
nginx mod PSGI
Yaroslav Korshak
 
RegistryModClass
John Zamoider
 

Recently uploaded (20)

PPTX
cloud computing vai.pptx for the project
vaibhavdobariyal79
 
PDF
How Open Source Changed My Career by abdelrahman ismail
a0m0rajab1
 
PDF
Brief History of Internet - Early Days of Internet
sutharharshit158
 
PDF
Data_Analytics_vs_Data_Science_vs_BI_by_CA_Suvidha_Chaplot.pdf
CA Suvidha Chaplot
 
PDF
How ETL Control Logic Keeps Your Pipelines Safe and Reliable.pdf
Stryv Solutions Pvt. Ltd.
 
PPTX
AI Code Generation Risks (Ramkumar Dilli, CIO, Myridius)
Priyanka Aash
 
PDF
CIFDAQ's Market Wrap : Bears Back in Control?
CIFDAQ
 
PDF
Researching The Best Chat SDK Providers in 2025
Ray Fields
 
PDF
State-Dependent Conformal Perception Bounds for Neuro-Symbolic Verification
Ivan Ruchkin
 
PDF
AI Unleashed - Shaping the Future -Starting Today - AIOUG Yatra 2025 - For Co...
Sandesh Rao
 
PDF
Responsible AI and AI Ethics - By Sylvester Ebhonu
Sylvester Ebhonu
 
PDF
Tea4chat - another LLM Project by Kerem Atam
a0m0rajab1
 
PDF
TrustArc Webinar - Navigating Data Privacy in LATAM: Laws, Trends, and Compli...
TrustArc
 
PDF
Make GenAI investments go further with the Dell AI Factory
Principled Technologies
 
PDF
The Future of Artificial Intelligence (AI)
Mukul
 
PDF
Per Axbom: The spectacular lies of maps
Nexer Digital
 
PPTX
Applied-Statistics-Mastering-Data-Driven-Decisions.pptx
parmaryashparmaryash
 
PDF
Research-Fundamentals-and-Topic-Development.pdf
ayesha butalia
 
PPTX
AVL ( audio, visuals or led ), technology.
Rajeshwri Panchal
 
PDF
The Future of Mobile Is Context-Aware—Are You Ready?
iProgrammer Solutions Private Limited
 
cloud computing vai.pptx for the project
vaibhavdobariyal79
 
How Open Source Changed My Career by abdelrahman ismail
a0m0rajab1
 
Brief History of Internet - Early Days of Internet
sutharharshit158
 
Data_Analytics_vs_Data_Science_vs_BI_by_CA_Suvidha_Chaplot.pdf
CA Suvidha Chaplot
 
How ETL Control Logic Keeps Your Pipelines Safe and Reliable.pdf
Stryv Solutions Pvt. Ltd.
 
AI Code Generation Risks (Ramkumar Dilli, CIO, Myridius)
Priyanka Aash
 
CIFDAQ's Market Wrap : Bears Back in Control?
CIFDAQ
 
Researching The Best Chat SDK Providers in 2025
Ray Fields
 
State-Dependent Conformal Perception Bounds for Neuro-Symbolic Verification
Ivan Ruchkin
 
AI Unleashed - Shaping the Future -Starting Today - AIOUG Yatra 2025 - For Co...
Sandesh Rao
 
Responsible AI and AI Ethics - By Sylvester Ebhonu
Sylvester Ebhonu
 
Tea4chat - another LLM Project by Kerem Atam
a0m0rajab1
 
TrustArc Webinar - Navigating Data Privacy in LATAM: Laws, Trends, and Compli...
TrustArc
 
Make GenAI investments go further with the Dell AI Factory
Principled Technologies
 
The Future of Artificial Intelligence (AI)
Mukul
 
Per Axbom: The spectacular lies of maps
Nexer Digital
 
Applied-Statistics-Mastering-Data-Driven-Decisions.pptx
parmaryashparmaryash
 
Research-Fundamentals-and-Topic-Development.pdf
ayesha butalia
 
AVL ( audio, visuals or led ), technology.
Rajeshwri Panchal
 
The Future of Mobile Is Context-Aware—Are You Ready?
iProgrammer Solutions Private Limited
 
Ad

ActionHeroJS Talk

  • 3. Estructura del Proyecto . ├── actions ├── bin ├── config ├── initializers ├── locales ├── log ├── node_modules ├── package.json ├── pids ├── public ├── README.md ├── servers ├── tasks └── test Las entidades principales como acciones, inicializadores o tareas se pueden generar usando el comando de actionhero npm run actionhero generate action -- --name=myFirstAction
  • 6. 'use strict' // npm run actionhero generate action -- --name=myFirstAction exports.action = { name: 'myFirstAction', description: 'an actionhero action', blockedConnectionTypes: [], outputExample: {}, matchExtensionMimeType: false, version: 1.0, toDocument: true, middleware: [], inputs: {}, run: function (api, data, next) { let error = null // your logic here return next(error) } } Acciones data = { connection: connection, action: 'randomNumber', toProcess: true, toRender: true, messageCount: 123, params: { action: 'randomNumber', apiVersion: 1 }, actionStartTime: 123, response: {}, }
  • 8. 'use strict' // npm run actionhero generate task -- // --name=myFirstTask --queue=default --frequency=0 exports.task = { name: 'myFirstTask', description: 'an actionhero task', frequency: 0, queue: 'default', middleware: [], plugins: [], run: function (api, params, next) { // your logic here // let error = new Error('something has gone wrong') // let resultLogMessage = {taskResult: 'ok'} // next(error, resultLogMessage) return next() } } Tareas
  • 9. 'use strict' // npm run actionhero generate initializer -- --name=myFirstInitializer module.exports = { loadPriority: 1000, startPriority: 1000, stopPriority: 1000, initialize: function (api, next) { api.myFirstInitializer = {} return next() }, start: function (api, next) { return next() }, stop: function (api, next) { return next() } } Inicializadores
  • 10. Action Cluster ● Cache ○ Get/Set ○ Listas ○ Bloqueos ● RPC ● Conexiones ● Pub/Sub api.connections.apply('abc123', 'set', ['auth', true], function(error, connectionDetails){ // do stuff });