MCPcopy Create free account
hub / github.com/ccxt/ccxt / append

Method append

python/ccxt/async_support/base/ws/cache.py:117–132  ·  view source on GitHub ↗
(self, item)

Source from the content-addressed store, hash-verified

115 return min(self._new_updates, limit)
116
117 def append(self, item):
118 if item[0] in self.hashmap:
119 reference = self.hashmap[item[0]]
120 if reference != item:
121 reference[0:len(item)] = item
122 else:
123 self.hashmap[item[0]] = item
124 if len(self._deque) == self._deque.maxlen:
125 delete_reference = self._deque.popleft()
126 del self.hashmap[delete_reference[0]]
127 self._deque.append(item)
128 if self._clear_updates:
129 self._clear_updates = False
130 self._size_tracker.clear()
131 self._size_tracker.add(item[0])
132 self._new_updates = len(self._size_tracker)
133
134
135class ArrayCacheBySymbolById(ArrayCache):

Callers 15

test_safe_methodsFunction · 0.95
handle_ohlcvMethod · 0.95
handle_ohlcvMethod · 0.95
handle_ohlcvMethod · 0.95
handle_uta_ohlcvMethod · 0.95
handle_ohlcvMethod · 0.95
handle_ohlcvMethod · 0.95
handle_ohlcvMethod · 0.95
handle_ohlcvMethod · 0.95
handle_ohlcvMethod · 0.95
handle_ohlcvMethod · 0.95
handle_ohlcvMethod · 0.95

Calls 3

appendMethod · 0.45
clearMethod · 0.45
addMethod · 0.45

Tested by 2

test_safe_methodsFunction · 0.76
test_ws_cacheFunction · 0.76