Actionhero is a realtime multi-transport nodejs API Server with integrated cluster capabilities and delayed tasks
APACHE-2.0 License
Published by evantahler about 11 years ago
actionHero start
and actionHero startCluster
actionHero start
actionHero startCluster
's workers would become unresponsive, especially when running in daemon modeconfig.js
to not have slaves log when running in cluster (this was a contribution to the unresponsive problem above)setIp
and setPort
as verbs
websocket
server has been updated to get these from faye's internalsactionHeroWebsocket.js
client-side js has been updated to not need to use these verbsactionHeroWebsocket.js
api.utils.hashmerge
to not mangle buffers
config.js
winston
serverOptions
for web and socket servers. This hash will be passed directly to https.createServer
and tls.createServer
serverOptions
configData.general.apiVersion
will start at 0.0.1
rather than match actionHero's release version as it has done previously.Published by evantahler about 11 years ago
configData.servers.web.urlPathForFiles = "/myProject/assets"
rather than just "assets".Published by evantahler about 11 years ago
config.js
to use at boot (--config=/path/to/file
)Published by evantahler about 11 years ago
postProcessAction
Change the middleware postProcessAction so that we can modify toRender
. This changes the syntax of a postProcesser to be:
api.actions.postProcessors.push(function(connection, actionTemplate, toRender, next){
next(connection, toRender);
});
if you set toRender = false;
your client will get no response unless you define a new response.
Misc & Bugs
nextTick
's from the web and file server. This will help with file server issues in node < 0.10.xPublished by evantahler over 11 years ago
API Documentation
actionHero will now provide API documentation to all web
clients who visit the /api route with no parameters (GET only). Other clients can request this information with the documentation
verb.
All actions and their metadata will be returned by this response. To hide an action, set action.toDocument = false
.
This deprecates the actionsView
action.
other
actionHeroWebSocketClient
has been updated to provide support for the new documentation verb
index.html
page updated to use new documentation and support Action versionsPublished by evantahler over 11 years ago
The title says it all!
This is a minor bug-fix release
Published by evantahler over 11 years ago
actionHero now integrates with jake (javascript make) to allow you to run manual jake tasks within actionHero's environment. Those of you coming from Ruby, jake is very similar to rake.
This release replaces the short-lived actionHero run
binary.
To use jake, you should install jake globally npm install -g jake
or you can use it locally by adding it to you package.json
actionHero will generate a few example jake tasks in ./jakelib/actionHero.jake
to help you save and restore the cache. Most importantly, the actionHero:envrionment
task is defined for you. Require this in all of you tasks so you can have access to the api
object within your tasks. You will have access to all of your initialized, actions, and tasks within the api object. api
will represent an initialized sever, but not a started one. Your initializer's "_start" methods will not be run, not will the servers be started. For example:
desc("my actionHero jake task");
task("myTask", {async: true}, function(){
var api = jake.Task["actionHero:envrionment"].value;
// your logic here
complete(process.exit());
});
As always, you can list your project's jake tasks with jake -T
> jake -T
jake actionHero:environment # I will load and init an actionHero environment
jake actionHero:actions:list # List your actions and metadata
jake actionHero:redis:flush # This will clear the entire actionHero redis database
jake actionHero:cache:clear # This will clear actionHero's cache
jake actionHero:cache:dump # This will save the current cache as a JSON object
jake actionHero:cache:load # This will load (and overwrite) the cache from a file
You can learn more about jake here.
You can view actionHero's default jake tasks here
Summary: This release prepares for multiple DB types and changes the cache to be in-memory
Details:
Summary: This release changes the way that actions and files are routed
Details:
config.json
with api.configData.urlPathForActions
and api.configData.urlPathForFiles
.api.configData.rootEndpointType
. Versions prior to this can be thought of as always choosing /api as the default. The default is api
./file
now works for socket connections. The raw contents of the file will be streamed back to the client upon success. Rather than sending HTTP headers on errors, a string messages in the normal way will be sent upon error.file
is still an action, but its logic is moved into the code API. Socket connections will only be using /api/ as their endpoint.Summary: This release contains a number of fixes for socket clients and some minor task updates.
Details:
context
in the JSON block returned.user
indicating they came form a user. Every minute a ping is sent from the server to keep the TCP connection alive and send the current time. This message has the context of api
. Messages resulting from data sent to the api (like an action) will have the response
context.response
context set to them by default.api
context.params
object.messageCount
value set. This will help clients keep messages in order.connection.id
set for them. This is used by the say
command and should be used by any other method which needs to identify one user to another. This way, the user's IP and port can be kept secret, but you can have a unique id for each user. Updates to how this hash is generated (now via MD5).Sorry, I wasn't keeping good notes :(
Summary: This release introduces the actionCluster!
Details:
actionHero can be run either as a stand-alone server or as part of a cluster. When running in cluster mode, the api will make use of the actionCluster methods. Features of an actionCluster:
ring-based
communication. Lists of peers are shared among all members of the actionCluster, and each member communicates directly with all other members. This allows any member of the cluster to fail and the cluster to continue.api.configData.actionCluster.Key
defined by yousay
socket command will message all clients in the same room in all peers. roomView
will aggregate information for all peer's connectionsapi.cache
is extended when operating in an actionCluster to allow for you to simply create redundant in-memory objects which can be accessed by any member of the cluster, even a peer which doesn't hold any of the data being accessed.api.configData.actionCluster.nodeDuplication
, you can ensure that your cached objects will be present on n peers to survive the crash of a peer. In the event a peer goes down, the remaining peers will reduplicate the object in questionSummary: This is a general cleanup release
Details:
Summary: This release adds additional functionality to the actionCluster and Cache
Details:
api.actionCluster.cache.load
and api.cache.load
now both return 4 values, (value, expireTimestamp, createdAt, readAt)
. This new information can be used to avoid race conditions if another peer has recently accessed a saved object./public/
which will demonstrate the showActions
methodactionHero.stop(next)
and actionHero.restart(next)
added to apiSummary: This is a general cleanup release
Details:
tasks.saveCacheToDisk
task. The api will also attempt to load in a cache file on boot.require('actionHero').createActionHero()
rather than require('actionHero').actionHero
. createActionHero()
will return a new instance of a server each time rather than a shared object.Summary: Goodbye Rate Limiting; Hello validators, and XML
Details:
outputType=XML
to the apiapi.rateLimitCheck
methodnpm start
can not be used to stat an example actionHero serverSummary: Goodbye Databases & Models, hello other versions of Node!
Details:
config.json
via api.configData.cache.cacheFolder
and api.configData.cache.cacheFile
Summary: Cluster Task Managment
Details:
./log/
if they are larger than api.configData.maxLogFileSize
api.cache.data
api.cache.data
to discSummary: OMG 1.0!
Details:
initializers
in your project's root. They will be loaded at boot and accessible like this:
connection.lastLine
configData.actionCluster.startingPeer
will be the only server to run 'any' tasks)
** SSL / HTTPS web server **
Details
config.json
for this belowSettings for https server:
"secureWebServer" : {
"port": 4443,
"enable": true,
"keyFile": "./certs/server-key.pem",
"certFile": "./certs/server-cert.pem"
},