Skip to content

Commit

Permalink
Merge pull request #4 from jwoertink/cleanup
Browse files Browse the repository at this point in the history
Cleanup
  • Loading branch information
jwoertink authored Apr 19, 2021
2 parents 2da7f6d + 0c23602 commit 1447329
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
1 change: 0 additions & 1 deletion .travis.yml

This file was deleted.

8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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`
Expand All @@ -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
```
Expand Down
2 changes: 2 additions & 0 deletions spec/lucky-cluster_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 1447329

Please sign in to comment.