Module: FastCurl

Defined in:
lib/fast_curl.rb,
lib/fast_curl/version.rb,
ext/fast_curl/fast_curl.c

Defined Under Namespace

Classes: Error, TimeoutError

Constant Summary collapse

DEFAULT_OPTIONS =
{
  connections: 20,
  timeout: 30
}.freeze
METHODS =
%i[get post put delete patch].freeze
BODY_METHODS =
%i[post put patch].freeze
VERSION =
"0.3.0"

Class Method Summary collapse

Class Method Details

.execute(*args) ⇒ Object



897
898
899
900
901
# File 'ext/fast_curl/fast_curl.c', line 897

static VALUE rb_fast_curl_execute(int argc, VALUE *argv, VALUE self) {
    VALUE requests, options;
    rb_scan_args(argc, argv, "1:", &requests, &options);
    return internal_execute(requests, options, -1, 0);
}

.first_execute(*args) ⇒ Object



903
904
905
906
907
908
909
910
911
912
913
# File 'ext/fast_curl/fast_curl.c', line 903

static VALUE rb_fast_curl_first_execute(int argc, VALUE *argv, VALUE self) {
    VALUE requests, options;
    rb_scan_args(argc, argv, "1:", &requests, &options);
    int count = 1;
    if (!NIL_P(options)) {
        VALUE c = rb_hash_aref(options, sym_count);
        if (!NIL_P(c))
            count = NUM2INT(c);
    }
    return internal_execute(requests, options, count, 0);
}

.stream_execute(*args) ⇒ Object



915
916
917
918
919
920
921
# File 'ext/fast_curl/fast_curl.c', line 915

static VALUE rb_fast_curl_stream_execute(int argc, VALUE *argv, VALUE self) {
    VALUE requests, options;
    rb_scan_args(argc, argv, "1:", &requests, &options);
    if (!rb_block_given_p())
        rb_raise(rb_eArgError, "stream_execute requires a block");
    return internal_execute(requests, options, -1, 1);
}