This commit is contained in:
Darien Raymond
2015-12-11 14:56:10 +00:00
parent a540d7dc99
commit b6ed26aedf
8 changed files with 162 additions and 2 deletions
+6 -1
View File
@@ -10,6 +10,7 @@ import (
type SpaceController struct {
packetDispatcher internal.PacketDispatcherWithContext
dnsCache internal.DnsCacheWithContext
pubsub internal.PubsubWithContext
}
func New() *SpaceController {
@@ -24,8 +25,12 @@ func (this *SpaceController) Bind(object interface{}) {
if dnsCache, ok := object.(internal.DnsCacheWithContext); ok {
this.dnsCache = dnsCache
}
if pubsub, ok := object.(internal.PubsubWithContext); ok {
this.pubsub = pubsub
}
}
func (this *SpaceController) ForContext(tag string) app.Space {
return internal.NewSpace(tag, this.packetDispatcher, this.dnsCache)
return internal.NewSpace(tag, this.packetDispatcher, this.dnsCache, this.pubsub)
}