markjaquith / WP-TLC-Transients

GNU General Public License v2.0
341 stars 37 forks source link

Ensure singleton for update server #18

Open markjaquith opened 11 years ago

markjaquith commented 11 years ago

The update server should be enforced as a singleton.

Rarst commented 11 years ago

So let's say we add static TLC_Transient_Update_Server::start() method for spinning copy of singleton. Do we make constructor private, as it is usual for singletons? If someone out there is doing new separately that will be breaking change for them.

Rarst commented 11 years ago

Alternate idea - what if we simply switch init() method to static? It will implicitly de-duplicate it on hooking. Server class doesn't seem to be doing anything that needs object instance so far.