Skip to content

[0.5.x] Questions about StreamIdSupplier #212

@yschimke

Description

@yschimke
  1. StreamIdSupplier.clientSupplier().nextStreamId() -> 3

Why not start with 1?

  1. isValid seems flipped

  2. Should isValid consider odds/even? clientSupplier and serverSupplier may be vastly out of sync.

    public static void main(String[] args) {
        StreamIdSupplier s = StreamIdSupplier.clientSupplier();

        System.out.println("1 " + s.isValid(1));

        System.out.println("next " + s.nextStreamId());
        System.out.println("next " + s.nextStreamId());

        System.out.println("3 " + s.isValid(3));
        System.out.println("4 " + s.isValid(4));
        System.out.println("5 " + s.isValid(5));
        System.out.println("6 " + s.isValid(6));
        System.out.println("7 " + s.isValid(7));
    }

Output

1 false
next 3
next 5
3 false
4 false
5 false
6 true
7 true

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions