 	import weavejs.WeaveAPI;
 	import weavejs.api.core.ILinkableHashMap;
 	import weavejs.api.core.ILinkableVariable;
+	import weavejs.api.data.IKeySet;
 	import weavejs.api.data.Aggregation;
 	import weavejs.api.data.ColumnMetadata;
 	import weavejs.api.data.DataType;


		public function WebSocketDataSource()
		{
		}

		public const keyType:LinkableString = Weave.linkableChild(this, LinkableString);
		public const keyProperty:LinkableString = Weave.linkableChild(this, LinkableString);
		public const keepLast:LinkableNumber = Weave.linkableChild(this, LinkableNumber, onKeepLastChange);
		//public const selectionFeedback:LinkableBoolean = Weave.linkableChild(this, LinkableBoolean);
		public const url:LinkableString = Weave.linkableChild(this, LinkableString, onUrlChange);


		private var _socket:Object = null;
		private function onUrlChange():void
		{
			if (_socket && _socket.readyState < 2)
			{
				_socket.close(1000, "No longer needed.");
				_socket = null;
			}

			records = [];
			propertyNames.clear();


			_socket = new JS.global.WebSocket(url.value);


		private function onError(event:Object):void
		{
			JS.error(event);
			/* Should we automatically retry here? */
			_socket = null;
		}

