0
我試圖從POST請求中射出火焰,就像Akka文檔中顯示的那樣。 http://doc.akka.io/docs/akka-http/current/scala/http/client-side/request-level.html#request-level-api從Akka的主演獲取上下文
但是,我試圖把它作爲另一個定義的類的內部。如果我嘗試添加任何需要Actor context
的信息,例如val http = HTTP(context.system)
,則會出現錯誤。我如何將上下文傳遞到我試圖從POST請求發出的類中?
trait CustomerProfilesComponent {
def customerProfileManager: CustomerService.Async
}
object DefaultCustomerProfiles {
private case class ProfileUpdateData(path: Seq[String], data: JsObject, metadata: JsObject)
}
trait DefaultCustomerProfiles extends CustomerProfilesComponent {
self: DatabaseComponent with SourceVersionComponent with ExecutionContextComponent =>
import DefaultCustomerProfiles._
lazy val customerProfileManager = new CustomerService.Async {
import db.api._
import AvroConverter._
override def getVersion : Future[AvroVersion] = {
Future.successful(toAvro(sourceVersion))
}
}