class Inquirer::Client

Overview

Contains many useful utilities & primitives for communicating with the Inquirer server/daemon.

Included Modules

Defined in:

inquirer/client.cr

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.new(config : Config) #

Makes a client from the given Inquirer config.


[View source]

Class Method Detail

def self.from(config : Config) #

Makes a client from the given Inquirer config.


[View source]

Instance Method Detail

def command(command : Command) : Response #

Sends a request to execute a command.

Assumes (and does not check) that the server is running.


[View source]
def running!(exit = false) #

Asserts the server is running.

Reports failure of that assertion using Console.exit if exit is true, otherwise using Console.error.

If assertion succeeded, returns self.


[View source]
def running? : Bool #

Returns whether the server is running.

Sends a Command::Ping command and checks if the response result is "pong". If it is, the Inquirer server this client is connected to is indeed running.


[View source]
def send(request : Request) : Response #

Sends raw request to the server.

Raises InquirerError if the server did not respond properly (and the socket error if it did not repond at all).


[View source]