summaryrefslogtreecommitdiff
path: root/cpp/src/IceStorm/Subscriber.h
diff options
context:
space:
mode:
authorMark Spruiell <mes@zeroc.com>2003-05-16 18:48:45 +0000
committerMark Spruiell <mes@zeroc.com>2003-05-16 18:48:45 +0000
commit1b193fc1a1d8b3f21e0fb83b7dce5822ba9ae5c7 (patch)
tree424b71a50fad11d1ffbd67a5ff1ad97635e23224 /cpp/src/IceStorm/Subscriber.h
parentreadline/ncurses update (diff)
downloadice-1b193fc1a1d8b3f21e0fb83b7dce5822ba9ae5c7.tar.bz2
ice-1b193fc1a1d8b3f21e0fb83b7dce5822ba9ae5c7.tar.xz
ice-1b193fc1a1d8b3f21e0fb83b7dce5822ba9ae5c7.zip
Changed the service to queue events to subscribers and links so that only
one thread at a time is delivering to a particular proxy. Event is now reference-counted, and QueuedProxy was added to manage the event queue. Before this change, a misbehaved subscriber could cause each invocation thread in the service to attempt to reconnect to the subscriber.
Diffstat (limited to 'cpp/src/IceStorm/Subscriber.h')
-rw-r--r--cpp/src/IceStorm/Subscriber.h21
1 files changed, 2 insertions, 19 deletions
diff --git a/cpp/src/IceStorm/Subscriber.h b/cpp/src/IceStorm/Subscriber.h
index a5b55c0a208..53d3e64cfd9 100644
--- a/cpp/src/IceStorm/Subscriber.h
+++ b/cpp/src/IceStorm/Subscriber.h
@@ -16,8 +16,8 @@
#define SUBSCRIBER_H
#include <IceUtil/Mutex.h>
-#include <Ice/Current.h> // For Ice::Context
#include <Ice/Identity.h>
+#include <IceStorm/Event.h>
#include <vector>
@@ -31,23 +31,6 @@ class TraceLevels;
typedef IceUtil::Handle<TraceLevels> TraceLevelsPtr;
//
-// Note that at present this requires to copy the event which isn't
-// nice. If this indeed becomes a bottleneck then either the event can
-// carry a reference to the blob, context & op (while event itself
-// isn't copied), or the op, blob & context can be passed along as
-// arguments (or do copy on write, or some such trick).
-//
-struct Event
-{
- bool forwarded;
- int cost;
- std::string op;
- Ice::OperationMode mode;
- std::vector< Ice::Byte> data;
- Ice::Context context;
-};
-
-//
// Subscriber interface.
//
class Subscriber : public virtual IceUtil::Shared
@@ -89,7 +72,7 @@ public:
// Publish the given event. Mark the state as Error in the event of
// a problem.
//
- virtual void publish(const Event&) = 0;
+ virtual void publish(const EventPtr&) = 0;
protected: