Module: Agoo

Defined in:
ext/agoo/agoo.c,
lib/agoo.rb,
lib/agoo/graphql.rb,
lib/agoo/version.rb,
lib/agoo/graphql/arg.rb,
lib/agoo/graphql/type.rb,
lib/agoo/graphql/field.rb,
ext/agoo/agoo.c

Overview

A High Performance HTTP Server that supports the Ruby rack API. The word agoo is a Japanese word for a type of flying fish.

Defined Under Namespace

Modules: Log, Server Classes: EarlyHints, ErrorStream, GraphQL, Graphql, RackLogger, Request, Response, Upgraded

Constant Summary collapse

VERSION =

Agoo version.

'2.15.12'

Class Method Summary collapse

Class Method Details

.publish(subject, message) ⇒ Object

call-seq: publish(subject, message)

Publish a message on the given subject. A subject is normally a String but Symbols can also be used as can any other object that responds to #to_s.



63
64
65
66
67
68
69
70
71
72
# File 'ext/agoo/agoo.c', line 63

VALUE
ragoo_publish(VALUE self, VALUE subject, VALUE message) {
    int		slen;
    const char	*subj = extract_subject(subject, &slen);

    rb_check_type(message, T_STRING);
    agoo_server_publish(agoo_pub_publish(subj, slen, StringValuePtr(message), (int)RSTRING_LEN(message)));

    return Qnil;
}

.shutdownObject

call-seq: shutdown()

Shutdown the server and logger.



49
50
51
52
53
54
# File 'ext/agoo/agoo.c', line 49

static VALUE
ragoo_shutdown(VALUE self) {
    agoo_shutdown();

    return Qnil;
}

.unsubscribe(subject) ⇒ Object

call-seq: unsubscribe(subject)

Unsubscribes on client listeners on the specified subject. Subjects are normally Strings but Symbols can also be used as can any other object that responds to #to_s.



82
83
84
85
86
87
88
89
# File 'ext/agoo/agoo.c', line 82

static VALUE
ragoo_unsubscribe(VALUE self, VALUE subject) {
    rb_check_type(subject, T_STRING);

    agoo_server_publish(agoo_pub_unsubscribe(NULL, StringValuePtr(subject), (int)RSTRING_LEN(subject)));

    return Qnil;
}