All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.socrata.http.impl.EnrichedBoundRequestBuilder.scala Maven / Gradle / Ivy

package com.socrata.http
package impl

import com.ning.http.client.{Response, AsyncHttpClient}

import com.socrata.future.{ExecutionContext, Future}

class EnrichedBoundRequestBuilder(b: AsyncHttpClient#BoundRequestBuilder) {
  /** Build the request and send it off to an HTTP server.
   *
   * @param consumer The entry point into the state machine managed by a [[com.socrata.http.NiceAsyncHandler]]
   * @param executionContext A strategy for starting tasks asynchronously. */
  def makeRequest[T](consumer: StatusConsumer[T])(implicit executionContext: ExecutionContext): Future[T] = {
    WrappedFuture(b.execute(new NiceAsyncHandler(consumer)))
  }

  def makeRequest()(implicit executionContext: ExecutionContext): Future[Response] = {
    WrappedFuture(b.execute())
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy