Manager paradigm change to an event-loop concurrency style, begun implementing batching in binance futures_websocket.go

This commit is contained in:
2025-09-07 12:01:36 +00:00
parent 98c030c562
commit 70f3714d2f
10 changed files with 1210 additions and 575 deletions

View File

@@ -22,7 +22,7 @@ func NewGRPCControlServer(m *manager.Manager) *GRPCControlServer {
}
// StartStream creates a new session. It does NOT attach client channels.
// Your streaming RPC should later call GetChannels(sessionID, opts).
// Your streaming RPC should later call AttachClient(sessionID, opts).
func (s *GRPCControlServer) StartStream(_ context.Context, req *pb.StartStreamRequest) (*pb.StartStreamResponse, error) {
sessionID, err := s.manager.NewSession(time.Duration(1) * time.Minute) // timeout set to 1 minute
if err != nil {
@@ -51,7 +51,7 @@ func (s *GRPCControlServer) ConfigureStream(_ context.Context, req *pb.Configure
ids = append(ids, id)
}
if err := s.manager.SetSubscriptions(streamID, ids); err != nil {
if err := s.manager.ConfigureSession(streamID, ids); err != nil {
// Map common manager errors to gRPC codes.
switch err {
case manager.ErrSessionNotFound: