class Runcobo::Tasks::DevServer

Overview

Builds src/main.cr, runs it, and rebuilds and restarts it when its sources change. A new binary replaces the running server only after it builds, so a broken edit leaves the previous version serving.

Defined in:

tasks/dev_server.cr

Constant Summary

ENTRY = "src/main.cr"
STOP_TIMEOUT = 10.seconds

Constructors

Instance Method Summary

Constructor Detail

def self.new(settings : Config, environment : Hash(String, String), output : IO = STDERR, interval : Time::Span = 0.5.seconds) #

[View source]

Instance Method Detail

def binary : Path #

[View source]
def restart : Bool #

Builds a new binary and swaps it in only if the build succeeds.


[View source]
def run #

[View source]
def stop #

Asks the server to shut down gracefully, then kills it after STOP_TIMEOUT.


[View source]