From 0c23602245518822f5926748fa994dd75a98d312 Mon Sep 17 00:00:00 2001 From: Jeremy Woertink Date: Mon, 19 Apr 2021 11:21:51 -0700 Subject: [PATCH] There's no specs, so no need to kick off travis. Also updating the README to remove the build status because it'll always fail on travis --- .travis.yml | 1 - README.md | 8 +++++--- spec/lucky-cluster_spec.cr | 2 ++ 3 files changed, 7 insertions(+), 4 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index ffc7b6a..0000000 --- a/.travis.yml +++ /dev/null @@ -1 +0,0 @@ -language: crystal diff --git a/README.md b/README.md index 3a3f742..4cdb2a6 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# lucky-cluster [![Build Status](https://travis-ci.com/jwoertink/lucky-cluster.svg?branch=master)](https://travis-ci.com/jwoertink/lucky-cluster) +# lucky-cluster -When you currently boot your lucky app, you boot 1 single process. If you're running on a beast server, then you're missing out on some free performance! +When a lucky app boots, it's only 1 single process. If you're running on a beast server, then you're missing out on some free performance! This shards lets you boot multiple processes of your lucky app. ## Installation @@ -27,7 +27,7 @@ require "lucky-cluster" ```crystal app_server = Lucky::Cluster.new ``` -4. Remove the `Signal::INT.trap` block. We will handle that for you. +4. Remove the `Signal::INT.trap` block. `lucky-cluster` handles that for you. 5. You can remove the extra `puts` in there too, if you want. 6. Optionally, specify the number of processes to boot with `app_server.threads = 2` @@ -47,6 +47,8 @@ app_server = Lucky::Cluster.new # This boots a new process for each thread. app_server.threads = ENV.fetch("MAX_THREADS") { "10" }.to_i +# You can also use this: +# app_server.threads = System.cpu_count app_server.listen ``` diff --git a/spec/lucky-cluster_spec.cr b/spec/lucky-cluster_spec.cr index 3256698..a7047a5 100644 --- a/spec/lucky-cluster_spec.cr +++ b/spec/lucky-cluster_spec.cr @@ -2,4 +2,6 @@ require "./spec_helper" describe Lucky::Cluster do # TODO: Write tests + # This would require either pulling in a generated Lucky app as a dependency, + # or faking an HTTP server to test that it boots multiple processes end