Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Commits on Mar 20, 2014
  1. @godfat
  2. @godfat
Commits on Feb 24, 2014
  1. @godfat

    placeholder for fiber pool

    godfat authored
  2. @godfat
  3. @godfat

    since we can't kill threads in thread pool, let's at least

    godfat authored
    make sure rest-client have a timeout which would fire eventually.
    we don't want to lock a thread in a pool.
  4. @godfat

    cover some cases for timeout

    godfat authored
Commits on Feb 23, 2014
  1. @godfat

    implement a queue which would kill idle workers

    godfat authored
    also introduce a config: pool_idle_time, default to 60 seconds
  2. @godfat

    try to drain the queue and block on shutting down

    godfat authored
    should never really add another job while shutting down though!
  3. @godfat
  4. @godfat

    fix log wording

    godfat authored
  5. @godfat

    fix deleting the thread

    godfat authored
  6. @godfat

    that's only for debugging

    godfat authored
  7. @godfat

    spawn threads on demand

    godfat authored
    TODO: timeout is not handled properly...
  8. @godfat
Commits on Feb 22, 2014
  1. @godfat

    less ivar

    godfat authored
  2. @godfat
  3. @godfat

    human readable inspect

    godfat authored
Commits on Feb 21, 2014
  1. @godfat

    First thread pool support

    godfat authored
    So we introduce RestCore::CLIENT to hold the client class to get the
    corresponding thread pool. We want different thread pools for different
    clients I assume. By default, we set Client.pool_size to 0 to disable
    thread pool, so that we could have unlimited concurrency power.
    
    Additionally, setting Client.pool_size to a negative value, e.g. -1
    would be telling rest-core that do not spawn any thread, just do a
    blocking call there.
    
    For now, our thread pool would always pre-allocate all threads.
    That is, if we set pool_size to 100, it would then spawn 100 threads
    upon first call. This might not be desired, but it's much easier to
    implement as the first version. Also, currently there's no way to
    shutdown the thread pool, so those threads live in the pool would
    live forever (until the process is died). This might also not be
    desired, but much easier to implement.
    
    We could also implement trimming in the future. That is, if we're
    only using a very small number of threads in the pool, we could
    slowly shut some threads down, and spawn more whenever we really need.
    
    Summary, for now:
    
    * Client.pool_size =  0 # Spawning a new thread each time.
    * Client.pool_size =  9 # Use 9 threads totally for this client.
    * Client.pool_size = -1 # Use no additional thread, doing blocking call.
    
    TODO:
    
    * Spawning threads on demand instead of spawning all all the time.
    * Automatically trim the thread pool whenever there are idle threads.
    * The ability to shutdown the thread pool elegantly.
    
    I'll probably take puma's thread pool implementation as a reference.
    https://github.com/puma/puma/blob/v2.7.1/lib/puma/thread_pool.rb
  2. @godfat

    just call warn for now

    godfat authored
  3. @godfat
  4. @godfat
  5. @godfat
Commits on Feb 19, 2014
  1. @godfat
  2. @godfat
  3. @godfat
  4. @godfat
  5. @godfat

    promote promise to be top-level

    godfat authored
  6. @godfat

    change terminologies for futures and promises

    godfat authored
    * rename Future to Promise
    * rename Proxy to Future
    * rename Future#on_load to Promise#fulfill
    * rename Future#on_error to Promise#reject
    * rename Future#wrap to Promise#gofor
    
    we also tried to make eventmachine's timeout more like rest-client
    in this commit.
Commits on Feb 18, 2014
  1. @godfat

    remove extra spaces

    godfat authored
Commits on Jan 22, 2014
  1. @godfat
Commits on Jan 7, 2014
  1. @godfat
  2. @godfat
Commits on Jan 6, 2014
  1. @godfat

    bump gemspec

    godfat authored
  2. @godfat
  3. @godfat

    fix comment

    godfat authored
Something went wrong with that request. Please try again.