ScenicFramework / scenic

Core Scenic library
Apache License 2.0
1.99k stars 137 forks source link

Optionally disable sending current value after subscription #298

Closed ademenev closed 5 months ago

ademenev commented 2 years ago

Description

Adds an option to Scenic.PubSub.subscribe to disable sending current value immediately.

Motivation and Context

When subscribing for a source, the current value is sent immediately if exists. Sometimes this behaviour is not desired, for example if we are not interested in past state, but only only want new events. In my particular use case, there is hardware that generates an event when a coin is inserted into coin acceptor, but the scene is only interested in payments made after it was started

Types of changes

Checklist

crertel commented 7 months ago

@ademenev Sorry for the extremely late review--is it alright for now if we simply disregard the return of subscribe/2 in client code? I think that would accomplish the same thing, yes?

crertel commented 5 months ago

Closing for now, please re-open if needed. :)