What is the meaning of the tilde arrow in this context?

This is the code from https://github.com/eigengo/activator-spray-twitter/blob/master/src/main/scala/core/tweetstream.scala

What does ~> (tilde arrow) mean? I think it should be an HttpRequest statement, but I could not find such a statement in the API.

I can understand that authorize is a function that returns (HttpRequest => HttpRequest), so val rq should be HttpRequest, which returned a value after applying the returned authorization function.

def receive: Receive = {
    case query: String =>
      val body = HttpEntity(ContentType(MediaTypes.`application/x-www-form-urlencoded`), s"track=$query")
      val rq = HttpRequest(HttpMethods.POST, uri = uri, entity = body) ~> authorize
      sendTo(io).withResponsesReceivedBy(self)(rq)
    case ChunkedResponseStart(_) =>
    case MessageChunk(entity, _) => TweetUnmarshaller(entity).fold(_ => (), processor !)
    case _ =>
  }

Thanks in advance!

+4
source share
1 answer

An operator is just a function, and it is defined implicitly, see line 32 here .

. .

, : intellij scala -IDE Ctrl-. IDE .

+2

Source: https://habr.com/ru/post/1535565/


All Articles