func NewLocus(rsc *Resources) *Locus {
	var err error
	locus := &Locus{
		rsc:  rsc,
		tube: tube.New(rsc.Kin, rsc.TubeTopic),
	}
	// Create an RH directory lens into the local file system, to give to the RH server namespace
	var fsFID rh.FID
	if rsc.FS != nil {
		fsSSN, err := rsc.FS.SignIn("", "/")
		if err != nil {
			panic(err)
		}
		if fsFID, err = fsSSN.Walk(nil); err != nil {
			panic(err)
		}
	}
	// Create server RH
	if fsFID != nil {
		locus.serverDir, err = server.NewDir(rsc.Kin.XID(), server.Resource{"fs", fsFID})
	} else {
		locus.serverDir, err = server.NewDir(rsc.Kin.XID())
	}
	if err != nil {
		panic(err)
	}
	//
	locus.Peer = &client.Peer{
		// It is crucial to use permanent cross-references, and not
		// "plain" ones within values stored inside the tube table. If
		// cross-references are used, they are managed by the cross-
		// garbage collection system and therefore connections to ALL
		// underlying workers are maintained superfluously.
		Kin:    rsc.Kin.XID(),
		Server: circuit.PermRef(xy.XServer{nsrv.NewServer(locus.serverDir)}),
	}
	//
	go loopJoin(rsc.KinJoin)
	go locus.loopLeave(rsc.KinLeave)
	go locus.loopExpire()
	//
	log.Println(locus.Peer.Key())
	return locus
}
// NewLocus creates a new locus device.
NewLocus creates a new locus device.
// NewLocus creates a new locus device .
func NewLocus(rsc *Resources) *Locus {
	var err error
	locus := &Locus{
		rsc:  rsc,
		tube: tube.New(rsc.Kin, rsc.TubeTopic),
	}
	var fsFID rh.FID
	if rsc.FS != nil {
		fsSSN, err := rsc.FS.SignIn("", "/")
		if err != nil {
			panic(err)
		}
		if fsFID, err = fsSSN.Walk(nil); err != nil {
			panic(err)
		}
	}
	if fsFID != nil {
		locus.serverDir, err = server.NewDir(rsc.Kin.XID(), server.Resource{"fs", fsFID})
	} else {
		locus.serverDir, err = server.NewDir(rsc.Kin.XID())
	}
	if err != nil {
		panic(err)
	}
	locus.Peer = &client.Peer{
		 It is crucial to use permanent cross-references, and not
		 "plain" ones within values stored inside the tube table. If
		 cross-references are used, they are managed by the cross-
		 garbage collection system and therefore connections to ALL
		 underlying workers are maintained superfluously.
		Kin:    rsc.Kin.XID(),
		Server: circuit.PermRef(xy.XServer{nsrv.NewServer(locus.serverDir)}),
	}
	go loopJoin(rsc.KinJoin)
	go locus.loopLeave(rsc.KinLeave)
	go locus.loopExpire()
	log.Println(locus.Peer.Key())
	return locus
}
func NewLocus ( rsc * Resources ) * Locus { var err error locus := & Locus { rsc : rsc , tube : tube . New ( rsc . Kin , rsc . TubeTopic ) , } var fsFID rh . FID if rsc . FS != nil { fsSSN , err := rsc . FS . SignIn ( " " , " " ) if err != nil { panic ( err ) } if fsFID , err = fsSSN . Walk ( nil ) ; err != nil { panic ( err ) } } if fsFID != nil { locus . serverDir , err = server . NewDir ( rsc . Kin . XID ( ) , server . Resource { " " , fsFID } ) } else { locus . serverDir , err = server . NewDir ( rsc . Kin . XID ( ) ) } if err != nil { panic ( err ) } locus . Peer = & client . Peer { Kin : rsc . Kin . XID ( ) , Server : circuit . PermRef ( xy . XServer { nsrv . NewServer ( locus . serverDir ) } ) , } go loopJoin ( rsc . KinJoin ) go locus . loopLeave ( rsc . KinLeave ) go locus . loopExpire ( ) log . Println ( locus . Peer . Key ( ) ) return locus }
NewLocus creates a new locus device.
NewLocus creates a new locus device .
// Create an RH directory lens into the local file system, to give to the RH server namespace // Create server RH // // It is crucial to use permanent cross-references, and not // "plain" ones within values stored inside the tube table. If // cross-references are used, they are managed by the cross- // garbage collection system and therefore connections to ALL // underlying workers are maintained superfluously. // //