// NewDTopic returns a new distributed topic instance.
// Parameters:
//   * name: DTopic name.
//   * concurrency: Maximum number of concurrently processing DTopic messages.
//   * flag: Any flag to control DTopic behaviour.
// Flags for delivery options:
//   * UnorderedDelivery: Messages are delivered in random order. It's good to distribute independent events in a distributed system.
//   * OrderedDelivery: Messages are delivered in order. Not implemented yet.
NewDTopic returns a new distributed topic instance.
Parameters:
name: DTopic name.
concurrency: Maximum number of concurrently processing DTopic messages.
flag: Any flag to control DTopic behaviour.
Flags for delivery options:
UnorderedDelivery: Messages are delivered in random order. It's good to distribute independent events in a distributed system.
OrderedDelivery: Messages are delivered in order. Not implemented yet.
// NewDTopic returns a new distributed topic instance . // Parameters : // * name : DTopic name . // * concurrency : Maximum number of concurrently processing DTopic messages . // * flag : Any flag to control DTopic behaviour . // Flags for delivery options : // * UnorderedDelivery : Messages are delivered in random order . It ' s good to distribute independent events in a distributed system . // * OrderedDelivery : Messages are delivered in order . Not implemented yet .
func (c *Client) NewDTopic(name string, concurrency int, flag int16) (*DTopic, error) {
	if flag&olric.UnorderedDelivery == 0 && flag&olric.OrderedDelivery == 0 {
		return nil, fmt.Errorf("invalid delivery mode: %w", olric.ErrInvalidArgument)
	}
	if flag&olric.OrderedDelivery != 0 {
		return nil, olric.ErrNotImplemented
	}
	return &DTopic{
		Client:      c,
		name:        name,
		flag:        flag,
		concurrency: concurrency,
		listeners:   make(map[uint64]struct{}),
	}, nil
}
func ( c * Client ) NewDTopic ( name string , concurrency int , flag int16 ) ( * DTopic , error ) { if flag & olric . UnorderedDelivery == 0 && flag & olric . OrderedDelivery == 0 { return nil , fmt . Errorf ( " " , olric . ErrInvalidArgument ) } if flag & olric . OrderedDelivery != 0 { return nil , olric . ErrNotImplemented } return & DTopic { Client : c , name : name , flag : flag , concurrency : concurrency , listeners : make ( map [ uint64 ] struct { } ) , } , nil }
NewDTopic returns a new distributed topic instance.
NewDTopic returns a new distributed topic instance .