Add PropertyStream

This commit is contained in:
Vinnie Falco
2013-10-06 11:07:25 -07:00
parent b9e0208aee
commit 1ae3328642
24 changed files with 839 additions and 157 deletions

View File

@@ -290,6 +290,23 @@ public:
m_queue.dispatch (bind (&Thread::signalThreadShouldExit, this));
}
//--------------------------------------------------------------------------
//
// PropertyStream
//
void onWrite (PropertyStream stream)
{
stream ["peers"] = m_logic.m_slots.peerCount;
stream ["in"] = m_logic.m_slots.inboundCount;
stream ["out"] = m_logic.m_slots.outboundCount;
stream ["out_desired"] = m_logic.m_slots.outDesired;
stream ["in_avail"] = m_logic.m_slots.inboundSlots;
stream ["in_max"] = m_logic.m_slots.inboundSlotsMaximum;
stream ["minutes"] = m_logic.m_slots.uptimeMinutes();
stream ["round"] = m_logic.m_slots.roundUpwards();
}
//--------------------------------------------------------------------------
void onDeadlineTimer (DeadlineTimer& timer)
@@ -358,7 +375,8 @@ public:
//------------------------------------------------------------------------------
Manager::Manager (Stoppable& parent)
: Stoppable ("PeerFinder", parent)
: PropertyStream::Source ("peerfinder")
, Stoppable ("PeerFinder", parent)
{
}