Releases: actionhero/actionhero
4.2.1
Allowing support to limit the connection.type for which an action if valid for. Define the array of action.blockedConnectionTypes = ['socket', 'webSocket']
for example to not allow access from TCP or webSocket clients. Not defining the array will allow all client types in.
v4.2.0
General
This release changes (simplifies) a number of APIs, but it does introduce changes. Please read the wiki, specifically the API methods page, to learn the new syntax for various methods.
- circular references are bad... remove all functions that require api to be passed in (mainly the API object)
- change initializer names to remove (init)
- object-ize connections, append connection-type prototypes in the server setups
- remove connection classes from utils
- remove global 'requires' from the API object, put them in the initializers that need them
- remove the notion of 'public' from connection objects
- server shutdown needs to clear its connections from the chatrooms
- delayed tasks which are older than 1 min should be checked against the various queues to be sure exist
- fix http message request so that all pending messages are returned
- general project organization
v4.1.0
Tasks
-
Tasks will no longer be 'popped' from a queue, but rather slid from queue to queue. This makes it much harder to loose a task
-
There is no longer a need for a periodc task reloader because of the above
-
Tasks can now be easily inspectd, and have been included in the
status
task -
Please check the wiki for new task syntax:
var task = new api.task({ name: "myTaskName", runAt: new Date().getTime() + 30000, // run 30 seconds from now params: {email: 'evantahler@gmail.com'}, // any optional params to pass to the task toAnnounce: true // to log the run of this task or not }); task.equeue(function(err){ // enqueued! })
Stats
- Stats system has been overhaled to have both local and global tasks kept for the cluster
- the
status
action now reflects the global status and local status for the server queried - Please check the wiki for new syntax:
api.stats.increment(api, key, count, next)
- next(err, wasSet)
- key is a string
- count is a signed integer
- - this method will work on local and global stats
api.stats.set(api, key, count, next)
- next(err, wasSet)
- key is a string
- count is a signed integer
- this method will only work on local stats
api.stats.get(api, key, collection, next)
- next(err, data)
- key is a string
- collection is either:
api.stats.collections.local
api.stats.collections.global
api.stats.getAll(api, next)
- next(err, stats)
- stats is a hash of
{global: globalStats, local: localStats}
v4.0.7
Bugs
- Typo: additionalListiningRooms -> additionalListeningRooms
- Convert all tabs to spaces, for those of us who are OCD (me)
- updates to the actionHeroWebSocket
v4.0.6
initializers can now have a _start(api, callback)
method which will be invoked when the server boots.
Bugs
api.tasks.inspect
has been renamedapi.tasks.inspectTasks
as to work with console.log and util.inspect- api.cache actions now force a domain binding when used within an action or task. This will help broken actions not to crash the server. This is needed until the redis package is updated to support domains (Thanks @othiym23)
- Typo corrected in
api.configData.general.pidFileDirectory
- Other spelling fixes (Thanks @jacobbubu)!
v4.0.5
socket server & web sockets
- connections can regester to be notified about messages in chatRooms they are not currently in with
listenToRoom
andsilenceRoom
. You still need to be in a room tosay
and interact with the room, but this will allow clients to register for additional events. - various commands have had the
room
paramite added to thier responses to allow for clarity in the above situation. - the rooms that a connection is (optionally) additionally interseted in is saved at
connection.additionalListiningRooms
- you can limit the number of actions the server will process at a time for a connection with
api.configData.general.simultaniousActions
. Defaults to5
bugs
- when shutting down the socket-server, if a connection doesn't close withing 5 seconds (a pending action), the connection will be disconnected forcibly
- fixed a bug where messageCount would be overwritten in proxy connections for long-lasting actions
- file server now uses
pipe
as to not require loading all of the file's content into ram to serve the file - webserver no longer requires the 'file' action to exist
- removed the 'file' action, as it was confusing, and duplicated core functionality of the web server
- ctrl+c and ctrl+d will now properly exit a telnet (TCP) session to an actionHero server
v4.0.4
Bugs
- fix a sweeper bug introduced in the previous version
v4.0.3: creating _teardown methods and moving shut down behavior into each mo…
initializers
- you can now define api.{module}._teardown in any api module to be called at shutdown.
_teardown(api, next)
will passed to this method- a
_teardown
method is not required
Bugs
- fix duplicate headers sometimes returned to http(s) clients
- fixed logging for actionCluster
- fixed SIGWINCH so only daemonized clusters can use it
- added in a sweeper for api.cache, so that expired values will be deleted eventually
- better locking out of internal timers when the cluster is off
v4.0.2
Status Codes
- For HTTP(S) clients, you can now toggle
api.configData.commonWeb.returnErrorCodes
, which when enabled will only return the http status code200
for truly sucessful request (conneciton.error== null
), and an error HTTP response header when there is an error. - You can now set
connection.responseHttpCode
in your actions to indicate a specific HTTP error code for each request if something goes wrong. - The default
connection.responseHttpCode
whenapi.configData.commonWeb.returnErrorCodes
is enabled is400
(bad request). - If you request an action that doesn't exist in the mode
404
(Bad Request). - If you request an action without all the required params
422
(Unprocessable Entity).
v4.0.1
Binary
- better support for running the actionHero binary globally
- when generating a new project, the actionHero version will be locked
actionHero
generate will create a_project.js
initializer- you can now daemonize all of the actionHero commands (start, startCluster) with the
--daemon
. This will background the server or cluster - the actionHero server can now respond to basic unix signals (USR2 will restart, and KILL/INT will try a more graceful shutdown)
- general cleanup for the binary commands
actions
- you can now define more than one action or task in a file, like this:
exports.userAdd = {
name: 'userAdd',
description: 'i add a user',
inputs: {
required: ['email', 'password'],
optional: []
},
outputExample: {},
run: function(api, connection, next){
// your code here
next(connection, true);
}
};
exports.userDelete = {
name: 'userDelete',
description: 'i delete a user',
inputs: {
required: ['email', 'password'],
optional: []
},
outputExample: {},
run: function(api, connection, next){
// your code here
next(connection, true);
}
}
config
- the name of the log file is now based on the process name, to match the pidFiles
general
- uppon sever shutdown, all connected TCP clinents will recieve the message: {"status":"Bye!","context":"response","reason":"server shutdown"}