juliankrispel / Pollock

A canvas-based application which paints by itself.
2 stars 1 forks source link

Publish/Subscribe 'registerChannel' #20

Closed juliankrispel closed 10 years ago

juliankrispel commented 10 years ago

Do we really need registerChannel to be a public method? This could be called internally whenever setValue is first called for a particular channel.

ulikk commented 10 years ago

Good idea, this will probably make the code easier. I was not sure if strict channel management was a necessity.

ulikk commented 10 years ago

This will spawn some side effects however. Until now you had to properly subscribe to a channel (which had to exist), so the system will notify if you read or write from unknown channels. Automatically registering a channel when you subscribe to it (and it exists) would be an option. The problem with registering a channel on setValue is: how do you set a notification callback then?

ulikk commented 10 years ago

updated behavior: