// New returns a new observer.
New returns a new observer.
// New returns a new observer .
func New(serviceIRI *url.URL, providers *Providers, opts ...Option) (*Observer, error) {
	optns := &options{}
	for _, opt := range opts {
		opt(optns)
	}
	o := &Observer{
		serviceIRI:      serviceIRI,
		Providers:       providers,
		discoveryDomain: optns.discoveryDomain,
	}
	subscriberPoolSize := optns.subscriberPoolSize
	if subscriberPoolSize == 0 {
		subscriberPoolSize = defaultSubscriberPoolSize
	}
	ps, err := NewPubSub(providers.PubSub, o.handleAnchor, o.processDID, subscriberPoolSize)
	if err != nil {
		return nil, err
	}
	o.pubSub = ps
	return o, nil
}
func New ( serviceIRI * url . URL , providers * Providers , opts ... Option ) ( * Observer , error ) { optns := & options { } for _ , opt := range opts { opt ( optns ) } o := & Observer { serviceIRI : serviceIRI , Providers : providers , discoveryDomain : optns . discoveryDomain , } subscriberPoolSize := optns . subscriberPoolSize if subscriberPoolSize == 0 { subscriberPoolSize = defaultSubscriberPoolSize } ps , err := NewPubSub ( providers . PubSub , o . handleAnchor , o . processDID , subscriberPoolSize ) if err != nil { return nil , err } o . pubSub = ps return o , nil }
New returns a new observer.
New returns a new observer .