Check values on adding to Dict

As far as I see it, you would want to expose an API:

  1. Either via some functions new_stream_registry and addstream as you suggested.
  2. Or, defining your own type StreamRegistry with custom methods on getindex and setindex!.

In any case, that a Dict is used internally is an implementation detail and should be hidden. The second way might be nicer syntax wise, but I would only use it if StreamRegistry(...) isa AbstractDict in any reasonable sense.