订阅可连接热源时发生CancellationException

时间:2018-02-20 15:36:12

标签: java project-reactor reactive-streams

我正在使用reactor-core here

请考虑以下代码段:

from django.db.models import Subquery
user = Profile.objects.get(handle="philsheard")
qs_existing_profiles = Profiles.objects.all()
rels = TwitterRelationship.objects.filter(
    target=user.id,
).exclude(
    source__in=Subquery(qs_existing_profiles.values("id"))
).values_list(
    "source", flat=True
).order_by(
    "source"
).filter(
    source__gt=max_id_from_previous_batch  # An integer representing a previous `Relationship.source` id
)

预期产出:

Flux<String> flux = Flux.<String>create(sink -> sink.next("test"))
    .replay(1)
    .refCount();

flux.subscribe(System.out::println);
flux.next().subscribe(System.out::println); // The exception is thrown here!

实际输出:

test
test

对我而言,这是reactor-core库中的一个错误。我的陈述是正确的还是我错过了(误会)的东西?

谢谢, 斯蒂芬

1 个答案:

答案 0 :(得分:0)

确认这是bug。它固定在reactor-core 3.1.5