akka.stream.javadsl.Source.empty()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(3.4k)|赞(0)|评价(0)|浏览(140)

本文整理了Java中akka.stream.javadsl.Source.empty()方法的一些代码示例,展示了Source.empty()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Source.empty()方法的具体详情如下:
包路径:akka.stream.javadsl.Source
类名称:Source
方法名:empty

Source.empty介绍

暂无

代码示例

代码示例来源:origin: com.typesafe.play/play-streams_2.11

public CompletionStage<A> run(Materializer mat) {
  return Source.<E>empty().runWith(sink, mat);
}

代码示例来源:origin: com.typesafe.play/play-streams_2.12

public CompletionStage<A> run(Materializer mat) {
  return Source.<E>empty().runWith(sink, mat);
}

代码示例来源:origin: eclipse/ditto

private Route handleDevOpsPerRequest(final RequestContext ctx, final DevOpsCommand command) {
  return handleDevOpsPerRequest(ctx, Source.empty(), emptyRequestBody -> command);
}

代码示例来源:origin: eclipse/ditto

protected Route handlePerRequest(final RequestContext ctx, final Command command,
    final Function<JsonValue, JsonValue> responseTransformFunction) {
  return handlePerRequest(ctx, command.getDittoHeaders(), Source.empty(),
      emptyRequestBody -> command, responseTransformFunction);
}

代码示例来源:origin: eclipse/ditto

private Source<Success, NotUsed> createIndices(final String collectionName, final List<Index> indices) {
  if (indices.isEmpty()) {
    return Source.empty();
  }
  return Source.from(indices)
      .flatMapConcat(index -> createIndex(collectionName, index));
}

代码示例来源:origin: eclipse/ditto

protected Route handlePerRequest(final RequestContext ctx, final Command command) {
  return handlePerRequest(ctx, command.getDittoHeaders(), Source.empty(),
      emptyRequestBody -> command);
}

代码示例来源:origin: org.eclipse.ditto/ditto-services-utils-persistence

private Source<Success, NotUsed> dropIndices(final String collectionName, final List<String> indices) {
  if (indices.isEmpty()) {
    return Source.empty();
  }
  return Source.from(indices)
      .flatMapConcat(index -> dropIndex(collectionName, index));
}

代码示例来源:origin: org.eclipse.ditto/ditto-services-utils-persistence

private Source<Success, NotUsed> createIndices(final String collectionName, final List<Index> indices) {
  if (indices.isEmpty()) {
    return Source.empty();
  }
  return Source.from(indices)
      .flatMapConcat(index -> createIndex(collectionName, index));
}

代码示例来源:origin: eclipse/ditto

private Source<Success, NotUsed> dropIndices(final String collectionName, final List<String> indices) {
  if (indices.isEmpty()) {
    return Source.empty();
  }
  return Source.from(indices)
      .flatMapConcat(index -> dropIndex(collectionName, index));
}

代码示例来源:origin: eclipse/ditto

private static Graph<SourceShape<WithSender>, NotUsed> keepResultAndLogErrors(final Object result) {
  if (result instanceof WithSender) {
    return Source.single((WithSender) result);
  } else if (result instanceof DittoRuntimeException) {
    return Source.single(result)
        .log("PreEnforcer replied DittoRuntimeException")
        .withAttributes(INFO_LEVEL)
        .flatMapConcat(x -> Source.empty());
  } else {
    return Source.single(result)
        .log("PreEnforcer encountered unexpected exception")
        .withAttributes(ERROR_LEVEL)
        .flatMapConcat(x -> Source.empty());
  }
}

代码示例来源:origin: eclipse/ditto

private Route buildRetrieveThingsRoute(final RequestContext ctx, final DittoHeaders dittoHeaders) {
  return parameter(ThingsParameter.IDS.toString(), idsString ->
      parameterOptional(ThingsParameter.FIELDS.toString(), fieldsString ->
          handlePerRequest(ctx, dittoHeaders, Source.empty(), emptyRequestBody -> RetrieveThings
              .getBuilder((idsString).isEmpty() ? new String[0] : idsString.split(","))
              .selectedFields(calculateSelectedFields(fieldsString))
              .dittoHeaders(dittoHeaders).build())
      )
  );
}

相关文章