@@ -6,7 +6,6 @@ use graph::tokio_stream::wrappers::ReceiverStream;
66use std:: sync:: { atomic:: Ordering , Arc , RwLock } ;
77use std:: { collections:: HashMap , sync:: atomic:: AtomicUsize } ;
88use tokio:: sync:: mpsc:: { channel, Sender } ;
9- use uuid:: Uuid ;
109
1110use crate :: notification_listener:: { NotificationListener , SafeChannelName } ;
1211use graph:: components:: store:: SubscriptionManager as SubscriptionManagerTrait ;
@@ -89,7 +88,7 @@ impl StoreEventListener {
8988/// Manage subscriptions to the `StoreEvent` stream. Keep a list of
9089/// currently active subscribers and forward new events to each of them
9190pub struct SubscriptionManager {
92- subscriptions : Arc < RwLock < HashMap < String , Sender < Arc < StoreEvent > > > > > ,
91+ subscriptions : Arc < RwLock < HashMap < usize , Sender < Arc < StoreEvent > > > > > ,
9392
9493 /// Keep the notification listener alive
9594 listener : StoreEventListener ,
@@ -180,7 +179,8 @@ impl SubscriptionManager {
180179
181180impl SubscriptionManagerTrait for SubscriptionManager {
182181 fn subscribe ( & self ) -> StoreEventStreamBox {
183- let id = Uuid :: new_v4 ( ) . to_string ( ) ;
182+ static SUBSCRIPTION_COUNTER : AtomicUsize = AtomicUsize :: new ( 0 ) ;
183+ let id = SUBSCRIPTION_COUNTER . fetch_add ( 1 , Ordering :: SeqCst ) ;
184184
185185 // Prepare the new subscription by creating a channel and a subscription object
186186 let ( sender, receiver) = channel ( 100 ) ;
0 commit comments