Example #1
0
func (self *iterateState) iterateFunction(state *operations.IterateState) (end bool) {

	numberOfKeyElements := len(state.Key)
	clientId := client.Id(state.Key[numberOfKeyElements-2])
	subscriptionId := operations.SubscriptionId(state.Key[numberOfKeyElements-1])

	ns := new(operations.NotificationSubscribe)
	ns.ClientId = clientId
	ns.Id = subscriptionId

	// Get configuration from value
	returnConfiguration := new(operations.SubscribeReturnConfig)
	deserializeConfig(state.Value[0], returnConfiguration)

	valuePtr := self.opPut.Value
	hashesVar := self.opPut.Hashes

	returnconfig.ProcessSubscribeEntry(returnConfiguration,
		self.opPut.Key, valuePtr,
		hashesVar, ns)
	ns.DroppingIsAllowed = returnConfiguration.DroppingAllowed

	self.notificationReceiver(ns)
	return false
}
Example #2
0
func ProcessSubscribeEntry(returnConfig *operations.SubscribeReturnConfig,
	key types.Key, value types.Array,
	hashes hashes.Hashes, out *operations.NotificationSubscribe) {

	out.Deleted = value == nil
	ProcessScanEntry(&returnConfig.ReturnConfig, key, value,
		hashes, &out.ScanEntry)
}