facebookarchive / swift

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

Save/load request context when swift invokes method. #222

Closed haijunz closed 10 years ago

haijunz commented 10 years ago

Summary: When the method being invoked returns a ListenableFuture this callback could be run in some executor thread not managed by swift. This ensures the thread local context is installed correctly when the callback is called. If the method spawns threads during the method invocation, this doesn't help. It needs to use a customized executor that loads/saves request context.

alandau commented 10 years ago

lgtm