Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-4314

Observable head should take implicit ExecutionContext passed by consumer

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Unknown
    • Resolution: Works as Designed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Scala
    • Labels:

      Description

      Right now, Observable head hard codes an ExecutionContext. It would be preferable if library consumers could pass in an ExecutionContext of their choosing:

        def head()(implicit ec: ExecutionContext): Future[T] = {
          headOption().map {
            case Some(result) => result
            case None         => null.asInstanceOf[T] // scalastyle:ignore null
          }
        }
      

        Attachments

          Activity

            People

            Assignee:
            ross.lawley Ross Lawley
            Reporter:
            scott.rice@rallyhealth.com Scott Rice
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: