Esempio n. 1
0
        public void get_object_info(Hashtable query_json, string callbackid)
        {
            ArrayList _list = _mongodbproxy.find(0, 0, 0, query_json, null);

            hubproxy _hubproxy = _hubmanager.get_hub(juggle.Imodule.current_ch);

            if (_hubproxy == null)
            {
                return;
            }

            int       count     = 0;
            ArrayList _datalist = new ArrayList();

            foreach (var data in _list)
            {
                _datalist.Add(data);

                count++;

                if (count >= 100)
                {
                    _hubproxy.ack_get_object_info(callbackid, _datalist);

                    count     = 0;
                    _datalist = new ArrayList();
                }
            }
            if (count > 0 && count < 100)
            {
                _hubproxy.ack_get_object_info(callbackid, _datalist);
            }

            _hubproxy.ack_get_object_info_end(callbackid);
        }
Esempio n. 2
0
        public void get_object_info(string db, string collection, Hashtable query_json, string callbackid)
        {
            log.log.trace(new System.Diagnostics.StackFrame(true), service.timerservice.Tick, "get_object_info");

            ArrayList _list = _mongodbproxy.find(db, collection, 0, 0, 0, query_json, null);

            hubproxy _hubproxy = _hubmanager.get_hub(juggle.Imodule.current_ch);

            if (_hubproxy == null)
            {
                log.log.error(new System.Diagnostics.StackFrame(true), service.timerservice.Tick, "get_object_info hubproxy is null");
                return;
            }

            int       count     = 0;
            ArrayList _datalist = new ArrayList();

            if (_list.Count == 0)
            {
                _hubproxy.ack_get_object_info(callbackid, _datalist);
            }
            else
            {
                foreach (var data in _list)
                {
                    _datalist.Add(data);

                    count++;

                    if (count >= 100)
                    {
                        _hubproxy.ack_get_object_info(callbackid, _datalist);

                        count     = 0;
                        _datalist = new ArrayList();
                    }
                }
                if (count > 0 && count < 100)
                {
                    _hubproxy.ack_get_object_info(callbackid, _datalist);
                }
            }

            _hubproxy.ack_get_object_info_end(callbackid);
        }