Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 21 for PubSub (0.16 sec)

  1. internal/pubsub/pubsub.go

    func (ps *PubSub[T, M]) Publish(item T) {
    	ps.RLock()
    	defer ps.RUnlock()
    	for _, sub := range ps.subs {
    		if sub.types.Contains(Mask(item.Mask())) && (sub.filter == nil || sub.filter(item)) {
    			select {
    			case sub.ch <- item:
    			default:
    			}
    		}
    	}
    }
    
    // Subscribe - Adds a subscriber to pubsub system
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Tue Feb 06 16:57:30 GMT 2024
    - 5.2K bytes
    - Viewed (0)
  2. internal/pubsub/pubsub_test.go

    // GNU Affero General Public License for more details.
    //
    // You should have received a copy of the GNU Affero General Public License
    // along with this program.  If not, see <http://www.gnu.org/licenses/>.
    
    package pubsub
    
    import (
    	"fmt"
    	"testing"
    	"time"
    )
    
    func TestSubscribe(t *testing.T) {
    	ps := New[Maskable, Mask](2)
    	ch1 := make(chan Maskable, 1)
    	ch2 := make(chan Maskable, 1)
    	doneCh := make(chan struct{})
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Thu Jan 18 07:03:17 GMT 2024
    - 5.8K bytes
    - Viewed (0)
  3. internal/grid/trace.go

    type TraceParamsKey struct{}
    
    // traceRequests adds request tracing to the connection.
    func (c *Connection) traceRequests(p *pubsub.PubSub[madmin.TraceInfo, madmin.TraceType]) {
    	c.trace = &tracer{
    		Publisher: p,
    		TraceType: madmin.TraceInternal,
    		Prefix:    "grid",
    		Local:     c.Local,
    		Remote:    c.Remote,
    		Subroute:  "",
    	}
    }
    
    // subroute adds a specific subroute to the request.
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Fri Feb 02 22:54:54 GMT 2024
    - 4K bytes
    - Viewed (0)
  4. cmd/consolelogger.go

    	"github.com/minio/minio/internal/pubsub"
    	"github.com/minio/pkg/v2/logger/message/log"
    	xnet "github.com/minio/pkg/v2/net"
    )
    
    // number of log messages to buffer
    const defaultLogBufferCount = 10000
    
    // HTTPConsoleLoggerSys holds global console logger state
    type HTTPConsoleLoggerSys struct {
    	totalMessages  int64
    	failedMessages int64
    
    	sync.RWMutex
    	pubsub   *pubsub.PubSub[log.Info, madmin.LogMask]
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Fri Feb 02 00:13:57 GMT 2024
    - 5.4K bytes
    - Viewed (0)
  5. internal/grid/manager.go

    	Outgoing     func(n int64)               // Record outgoing bytes.
    	BlockConnect chan struct{}               // If set, incoming and outgoing connections will be blocked until closed.
    	TraceTo      *pubsub.PubSub[madmin.TraceInfo, madmin.TraceType]
    }
    
    // NewManager creates a new grid manager
    func NewManager(ctx context.Context, o ManagerOptions) (*Manager, error) {
    	found := false
    	if o.AuthRequest == nil {
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Thu Apr 04 12:04:40 GMT 2024
    - 9.5K bytes
    - Viewed (0)
  6. cmd/bootstrap-messages.go

    	bs.mu.RLock()
    	for _, i := range bs.info {
    		traceInfo = append(traceInfo, i)
    	}
    	bs.mu.RUnlock()
    
    	return traceInfo
    }
    
    func (bs *bootstrapTracer) Publish(ctx context.Context, trace *pubsub.PubSub[madmin.TraceInfo, madmin.TraceType]) {
    	for _, bsEvent := range bs.Events() {
    		if bsEvent.Message != "" {
    			select {
    			case <-ctx.Done():
    			default:
    				trace.Publish(bsEvent)
    			}
    		}
    	}
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Wed Aug 23 10:07:06 GMT 2023
    - 1.7K bytes
    - Viewed (0)
  7. cmd/globals.go

    	// global Trace system to send HTTP request/response
    	// and Storage/OS calls info to registered listeners.
    	globalTrace = pubsub.New[madmin.TraceInfo, madmin.TraceType](8)
    
    	// global Listen system to send S3 API events to registered listeners
    	globalHTTPListen = pubsub.New[event.Event, pubsub.Mask](0)
    
    	// global console system to send console logs to
    	// registered listeners
    	globalConsoleSys *HTTPConsoleLoggerSys
    
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Sun Apr 21 11:43:18 GMT 2024
    - 16.5K bytes
    - Viewed (0)
  8. cmd/listen-notification-handlers.go

    	"encoding/json"
    	"net/http"
    	"strconv"
    	"time"
    
    	"github.com/minio/minio/internal/event"
    	"github.com/minio/minio/internal/grid"
    	"github.com/minio/minio/internal/logger"
    	"github.com/minio/minio/internal/pubsub"
    	"github.com/minio/mux"
    	"github.com/minio/pkg/v2/policy"
    )
    
    func (api objectAPIHandlers) ListenNotificationHandler(w http.ResponseWriter, r *http.Request) {
    	ctx := newContext(r, w, "ListenNotification")
    
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Thu Apr 04 12:04:40 GMT 2024
    - 6K bytes
    - Viewed (0)
  9. internal/pubsub/mask.go

    package pubsub
    
    import (
    	"math"
    	"math/bits"
    )
    
    // Mask allows filtering by a bitset mask.
    type Mask uint64
    
    const (
    	// MaskAll is the mask for all entries.
    	MaskAll Mask = math.MaxUint64
    )
    
    // MaskFromMaskable extracts mask from an interface.
    func MaskFromMaskable(m Maskable) Mask {
    	return Mask(m.Mask())
    }
    
    // Contains returns whether *all* flags in other is present in t.
    func (t Mask) Contains(other Mask) bool {
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Tue Jul 05 21:45:49 GMT 2022
    - 1.3K bytes
    - Viewed (0)
  10. cmd/event-notification.go

    	"net/url"
    	"runtime"
    	"strings"
    	"sync"
    
    	"github.com/minio/minio/internal/crypto"
    	"github.com/minio/minio/internal/event"
    	xhttp "github.com/minio/minio/internal/http"
    	"github.com/minio/minio/internal/pubsub"
    	"github.com/minio/pkg/v2/policy"
    )
    
    // EventNotifier - notifies external systems about events in MinIO.
    type EventNotifier struct {
    	sync.RWMutex
    	targetList     *event.TargetList
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Thu Apr 04 12:04:40 GMT 2024
    - 7.8K bytes
    - Viewed (0)
Back to top