Top Level Namespace

Defined in:

Constant Summary

EXAMPLE_CONFIG = "#{Style.dim("exampleconfig.yml")}\n#{Style.dim("====")}\n#{Style.blue("search_terms")}: #{Style.green("\"lyrics\"")}\n#{Style.blue("binary_directory")}: #{Style.green("~/.irs/bin")}\n#{Style.blue("music_directory")}: #{Style.green("~/Music")}\n#{Style.blue("filename_pattern")}: #{Style.green("\"{track_number} - {title}\"")}\n#{Style.blue("directory_pattern")}: #{Style.green("\"{artist}/{album}\"")}\n#{Style.blue("client_key")}: #{Style.green("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")}\n#{Style.blue("client_secret")}: #{Style.green("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")}\n#{Style.blue("single_folder_playlist")}: \n #{Style.blue("enabled")}: #{Style.green("true")}\n #{Style.blue("retain_playlist_order")}: #{Style.green("true")}\n #{Style.blue("unify_into_album")}: #{Style.green("false")}\n#{Style.dim("====")}"

Method Summary

Method Detail

def delay(delay, &block : -> _) #

Spawns a Fiber to compute &block in the background after delay has elapsed. Access to get is synchronized between fibers. &block is only called once. May be canceled before &block is called by calling cancel.

d = delay(1) { Process.kill(Process.pid) }
long_operation
d.cancel

[View source]
def future(&exp : -> _) #

Spawns a Fiber to compute &block in the background. Access to get is synchronized between fibers. &block is only called once.

f = future { http_request }
... other actions ...
f.get #=> String

[View source]
def lazy(&block : -> _) #

Conditionally spawns a Fiber to run &block in the background. Access to get is synchronized between fibers. &block is only called once. &block doesn't run by default, only when get is called.

l = lazy { expensive_computation }
spawn { maybe_use_computation(l) }
spawn { maybe_use_computation(l) }

[View source]
def main #

[View source]
def parse_to_json(string_json : String) : JSON::Any #

[View source]