tags:

views:

64

answers:

2

Hello All, I've been trying to come up with a decent design for multiple factories access each others information. For example, I have the following services: 1 management web service, a VirtualHost instance (multiple domains) and a built in DNS service. Going through the finger tutorial was very helpful but it lacks some key points. It never has a service accessing or executing a method of a factory. I have a hard time believing everyone is implementing 100% of all their logic inside of a single service, and just using the various factories to call those methods defined in the service. If I wanted to update my DNS records, how would my management service tell the DNS Factory, 'hey reload your authority files'? Any hints on how everyone else is doing this sort of inter-factory inter-service communication?

A: 

Well, after some help from a friend. I figured it out. If you create a multiservice, you can just pass the multiservice object to all your child services (I pass it in the init). Then you do setName('servicename'). Then from another service you can just get the information like so: x = self.multiService.getServiceNamed('servicename') and access it that way. Works like a charm! -omgpants

omgpants
A: 

does that run on one port?

seattle
No, it runs on multiple ports. I have a single multiservice and i just so like: x = internet.TCPServer(port, factory(multiService)) then x.setName('whatever') x.setServiceParent(multiService), then inside my factory I can assign multiService, then look up other services by using something like self.multiService.getServiceNamed('whatever').
omgpants