facebookarchive / swift

An annotation-based Java library for creating Thrift serializable types and services.
Apache License 2.0
900 stars 297 forks source link

ThriftServerModule need to provide a bindWorkerExecutor() method with a Provider class #199

Closed l3fang closed 10 years ago

l3fang commented 10 years ago

bindWorkerExecutor() in ThriftServerModule only has three choices:

  1. bind to an executor type;
  2. bind to an executor instance;
  3. bind to a Provider instance

However, I need to have a flavor that binds to a Provider type. This is because 3. exposes the constructor for the Provider, which creates problems if the Provider needs dependencies. In particular, if I need to export the queue size as a stats value, I need dependencies on the stats library which is itself configured with Guice. Such a Provider cannot have its dependency satisfied in configure().