ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/zoe/trunk/Publisher.cpp
(Generate patch)

Comparing trunk/Publisher.cpp (file contents):
Revision 38 by douglas, 2004-07-22T22:42:40-07:00 vs.
Revision 43 by douglas, 2004-08-15T21:33:25-07:00

# Line 11 | Line 11
11   Publisher::Publisher(const std::set<Buddy>& buddies, const Database& database, bool start) : buddies(buddies),
12          database(database), start(start)
13   {
14 <        if (start) publisher.Spawn(etl::Bind<0>(&Publisher::publish, this));
14 >        if (start) publish();
15   }
16  
17 < int Publisher::publish()
18 < {
19 <        cerr << bright << green << "Started publisher daemon at " << Stamp()
20 <                << ".\n" << reset;
21 <
22 <        while (true)
23 <        {
24 <                Stamp now, next(now + Hour(1));
25 <                api::Thread thread(etl::Bind<0>(&Publisher::update, this));
26 <
27 <                next.setSeconds(0);
28 <                next.setMinutes(0);
29 <
30 <                if (Zoe::debug) cerr << "now = " << now << "\nnext = " << next << '\n';
31 <
32 <                while (now < next - Minute(1))
33 <                {
34 <                        sleep(Minute(1));
35 <
36 <                        now = Stamp();
37 <                }
38 <
39 <                while (now < next)
40 <                {
41 <                        sleep(1);
42 <
43 <                        now = Stamp();
44 <                }
45 <
46 <                thread.Join();
47 <        }
48 < }
49 <
50 < int Publisher::update()
17 > void Publisher::publish()
18   {
19          cerr << bright << yellow << "Started updating feeds at " << Stamp()
20                  << ".\n" << reset;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines