Hacker News new | ask | show | jobs
by wnoise 4114 days ago
What happens if you add a second camera?

The actor/CSP model makes each device a separate process, which can be hooked together with processing nodes works wonderfully.

3 comments

> What happens if you add a second camera?

You call it TheSecondCamera, duh.

If there's the potential for multiples then I'll have a CameraManager (TheCameraManager) that finds out what's connected to the system and provides enumeration and access. I'll generally try to make the cameras look like a singleton and hide the Camera class. Sort of like a factory, except you'll only ever get N instances of your Camera class for N cameras.
TheCameraArray[1]