stream(_:handle:) from StreamDelegate

When that function is called, will eventCode ever be more than one item? The documentation isn't really clear on this. eventCode is an OptionSet, not an enum, so in theory multiple items could exist at the same time, right?

Answered by DTS Engineer in 290208022

When that function is called, will

eventCode
ever be more than one item?

No.

The documentation isn't really clear on this.

Agreed. It’d help if you filed a bug against the docs here, specifically the places you looked for this answer.

eventCode
is an
OptionSet
, not an enum, so in theory multiple items could exist at the same time, right?

Correct. This is just a leaky abstraction.

Stream
uses the
OptionSet
internally to track the events that are pending, but it then makes sure that events are delivered to the delegate one at a time.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"
Accepted Answer

When that function is called, will

eventCode
ever be more than one item?

No.

The documentation isn't really clear on this.

Agreed. It’d help if you filed a bug against the docs here, specifically the places you looked for this answer.

eventCode
is an
OptionSet
, not an enum, so in theory multiple items could exist at the same time, right?

Correct. This is just a leaky abstraction.

Stream
uses the
OptionSet
internally to track the events that are pending, but it then makes sure that events are delivered to the delegate one at a time.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"
stream(_:handle:) from StreamDelegate
 
 
Q