~go-bot/juju-core/trunk

Viewing all changes in revision 2753.

  • Committer: Tarmac
  • Author(s): John Arbash Meinel
  • Date: 2014-05-20 10:11:48 UTC
  • mfrom: (2737.2.3 api-named-resources)
  • Revision ID: tarmac-20140520101148-n5q4zz6rnhyan2lz
[r=jameinel] state/apiserver/common: Resources.RegisterNamed

Two small changes here.

1) Change common.Resources to allow you to RegisterNamed rather than
   only allowing you to register and get back the Id. This was necessary
   for the second step, but generally allows us to declare Resources
   that Facades can know about that aren't reported to clients.

2) Change the pingTimeout object from being an attribute of srvRoot into
   being just another resource like the Watchers at a specific resource
   name.

While working on the changes for pingTimeout, I noticed that no tests
actually failed if I started returning nullTimeout. So I added a test
that ensures calling Ping() actually does delay the connection from
being closed. (We only had a test that if you never called Ping in time,
it would die, but not that Ping can delay that death.)

This is a step towards making all of the Facades follow a common
pattern, as this allows Pinger to also just take Resources rather than
needing to know about details of the srvRoot object.

https://codereview.appspot.com/93500044/

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: