Provides RequestLocalTime.current.requestedAt
, which is a consistent timestamp among a request-response lifetime.
See #1 for an example usage.
import com.github.laysakura.requestlocaltime.filters.SetRequestLocalTimeFilter
import com.twitter.finatra.thrift.ThriftServer
import com.twitter.finatra.thrift.routing.ThriftRouter
class YourServer extends ThriftServer
{
// ...
override def configureThrift(router: ThriftRouter) {
router
// other filters ...
.filter[SetRequestLocalTimeFilter]
.add[YourController]
}
}
It can be accessed from anywhere if the code path is reached by a request.