Giter Site home page Giter Site logo

Comments (5)

kostya avatar kostya commented on May 28, 2024

curl-crystal is not concurrent, it blocks crystal main thread, so it hard to run multiple requests at the same time (or even use it with http server or something). Surely builtin lib is much better, because allowed big concurrency (but it quite limited, no proxy, no socks, no redirects, no sessions, no some more features that curl have). For concurrency with curl-crystal i use: https://github.com/kostya/curl-downloader#example-with-thread_pool-to-execute-request-in-the-background-and-not-to-lock-crystal-main-thread, but it quite hack, and have problems with segfaults.

from curl-crystal.

waghanza avatar waghanza commented on May 28, 2024

to summarize, curl-crystal is performant and recommanded if, and only if you do not need concurrency.

to be factual, I want to create a CLI to (so no need of concurrency), so curl-crystal is well chosen, in this use case, right ?

from curl-crystal.

kostya avatar kostya commented on May 28, 2024

if you have only one request per time and no background things, so this lib if fine. i create simple wrapper for this lib: https://github.com/kostya/curl-downloader

from curl-crystal.

waghanza avatar waghanza commented on May 28, 2024

@kostya ok. seems nice ;-) I will try

from curl-crystal.

blocknotes avatar blocknotes commented on May 28, 2024

Hi @waghanza
Your question is right; basically I agree with @kostya

In most cases it's better to use the standard library built-in net functions.
This shard could be useful in some situations where some specific net options are needed or as alternative for testing purposes.

from curl-crystal.

Related Issues (2)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.