Skip to content

Commit

Permalink
Move async-service example to examples/.
Browse files Browse the repository at this point in the history
  • Loading branch information
ioquatix committed Mar 23, 2024
1 parent 17e2ca6 commit 66f7b3f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
4 changes: 2 additions & 2 deletions hello.rb → examples/async-service/hello.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
# Released under the MIT License.
# Copyright, 2024, by Samuel Williams.

require 'falcon/service/server'
require 'falcon/environments/server'

service "hello-server" do
include Falcon::Service::Server
include Falcon::Environments::Server

middleware do
::Protocol::HTTP::Middleware::HelloWorld
Expand Down
18 changes: 18 additions & 0 deletions examples/async-service/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Async::Service

Async::Service provides a generic service layer for managing the lifecycle of services.

Falcon provides several services which are managed by the service layer, including:

- `Falcon::Service::Server`: An HTTP server.
- `Falcon::Service::Supervisor`: A process supervisor (memory usage, etc).

The service layer can support multiple different services, and can be used to manage the lifecycle of any service, or group of services.

This simple example shows how to use `async-service` to start a web server.

``` shell
$ bundle exec async-service ./hello.rb
```

This will start a web server on port 9292 which responds with "Hello World!" to all requests.

0 comments on commit 66f7b3f

Please sign in to comment.