|
| 1 | +[redis-x-stream](../README.md) / [Exports](../modules.md) / RedisStream |
| 2 | + |
| 3 | +# Class: RedisStream<T\> |
| 4 | + |
| 5 | +## Type parameters |
| 6 | + |
| 7 | +Name | Type | Default | |
| 8 | +------ | ------ | ------ | |
| 9 | +`T` | [*Mode*](../modules.md#mode) | *entry* | |
| 10 | + |
| 11 | +## Hierarchy |
| 12 | + |
| 13 | +* **RedisStream** |
| 14 | + |
| 15 | +## Index |
| 16 | + |
| 17 | +### Constructors |
| 18 | + |
| 19 | +* [constructor](redisstream.md#constructor) |
| 20 | + |
| 21 | +### Properties |
| 22 | + |
| 23 | +* [ackOnIterate](redisstream.md#ackoniterate) |
| 24 | +* [block](redisstream.md#block) |
| 25 | +* [client](redisstream.md#client) |
| 26 | +* [consumer](redisstream.md#consumer) |
| 27 | +* [count](redisstream.md#count) |
| 28 | +* [createdConnection](redisstream.md#createdconnection) |
| 29 | +* [deleteOnAck](redisstream.md#deleteonack) |
| 30 | +* [done](redisstream.md#done) |
| 31 | +* [first](redisstream.md#first) |
| 32 | +* [group](redisstream.md#group) |
| 33 | +* [mode](redisstream.md#mode) |
| 34 | +* [noack](redisstream.md#noack) |
| 35 | +* [pendingAcks](redisstream.md#pendingacks) |
| 36 | +* [streams](redisstream.md#streams) |
| 37 | + |
| 38 | +### Methods |
| 39 | + |
| 40 | +* [[Symbol.asyncIterator]](redisstream.md#[symbol.asynciterator]) |
| 41 | +* [ack](redisstream.md#ack) |
| 42 | +* [quit](redisstream.md#quit) |
| 43 | +* [return](redisstream.md#return) |
| 44 | + |
| 45 | +## Constructors |
| 46 | + |
| 47 | +### constructor |
| 48 | + |
| 49 | +\+ **new RedisStream**<T\>(`options`: *string* \| [*RedisStreamOptions*](../interfaces/redisstreamoptions.md)<T\>, ...`streams`: *string*[]): [*RedisStream*](redisstream.md)<T\> |
| 50 | + |
| 51 | +#### Type parameters: |
| 52 | + |
| 53 | +Name | Type | Default | |
| 54 | +------ | ------ | ------ | |
| 55 | +`T` | [*Mode*](../modules.md#mode) | *entry* | |
| 56 | + |
| 57 | +#### Parameters: |
| 58 | + |
| 59 | +Name | Type | |
| 60 | +------ | ------ | |
| 61 | +`options` | *string* \| [*RedisStreamOptions*](../interfaces/redisstreamoptions.md)<T\> | |
| 62 | +`...streams` | *string*[] | |
| 63 | + |
| 64 | +**Returns:** [*RedisStream*](redisstream.md)<T\> |
| 65 | + |
| 66 | +Defined in: [stream.ts:58](https://github.com/calebboyd/pez/blob/557aceb/src/stream.ts#L58) |
| 67 | + |
| 68 | +## Properties |
| 69 | + |
| 70 | +### ackOnIterate |
| 71 | + |
| 72 | +• **ackOnIterate**: *boolean*= false |
| 73 | + |
| 74 | +Defined in: [stream.ts:37](https://github.com/calebboyd/pez/blob/557aceb/src/stream.ts#L37) |
| 75 | + |
| 76 | +___ |
| 77 | + |
| 78 | +### block |
| 79 | + |
| 80 | +• `Optional` **block**: *undefined* \| *number* |
| 81 | + |
| 82 | +Defined in: [stream.ts:34](https://github.com/calebboyd/pez/blob/557aceb/src/stream.ts#L34) |
| 83 | + |
| 84 | +___ |
| 85 | + |
| 86 | +### client |
| 87 | + |
| 88 | +• `Readonly` **client**: *Redis* |
| 89 | + |
| 90 | +Defined in: [stream.ts:26](https://github.com/calebboyd/pez/blob/557aceb/src/stream.ts#L26) |
| 91 | + |
| 92 | +___ |
| 93 | + |
| 94 | +### consumer |
| 95 | + |
| 96 | +• `Optional` `Readonly` **consumer**: *undefined* \| *string* |
| 97 | + |
| 98 | +Defined in: [stream.ts:28](https://github.com/calebboyd/pez/blob/557aceb/src/stream.ts#L28) |
| 99 | + |
| 100 | +___ |
| 101 | + |
| 102 | +### count |
| 103 | + |
| 104 | +• **count**: *number*= 100 |
| 105 | + |
| 106 | +Defined in: [stream.ts:32](https://github.com/calebboyd/pez/blob/557aceb/src/stream.ts#L32) |
| 107 | + |
| 108 | +___ |
| 109 | + |
| 110 | +### createdConnection |
| 111 | + |
| 112 | +• `Private` **createdConnection**: *boolean*= true |
| 113 | + |
| 114 | +Did we create the redis connection? |
| 115 | + |
| 116 | +Defined in: [stream.ts:58](https://github.com/calebboyd/pez/blob/557aceb/src/stream.ts#L58) |
| 117 | + |
| 118 | +___ |
| 119 | + |
| 120 | +### deleteOnAck |
| 121 | + |
| 122 | +• **deleteOnAck**: *boolean*= false |
| 123 | + |
| 124 | +Defined in: [stream.ts:38](https://github.com/calebboyd/pez/blob/557aceb/src/stream.ts#L38) |
| 125 | + |
| 126 | +___ |
| 127 | + |
| 128 | +### done |
| 129 | + |
| 130 | +• **done**: *boolean*= false |
| 131 | + |
| 132 | +Flag for iterable state |
| 133 | + |
| 134 | +Defined in: [stream.ts:50](https://github.com/calebboyd/pez/blob/557aceb/src/stream.ts#L50) |
| 135 | + |
| 136 | +___ |
| 137 | + |
| 138 | +### first |
| 139 | + |
| 140 | +• **first**: *boolean*= false |
| 141 | + |
| 142 | +Flag for first iteration |
| 143 | + |
| 144 | +Defined in: [stream.ts:54](https://github.com/calebboyd/pez/blob/557aceb/src/stream.ts#L54) |
| 145 | + |
| 146 | +___ |
| 147 | + |
| 148 | +### group |
| 149 | + |
| 150 | +• `Optional` `Readonly` **group**: *undefined* \| *string* |
| 151 | + |
| 152 | +Defined in: [stream.ts:27](https://github.com/calebboyd/pez/blob/557aceb/src/stream.ts#L27) |
| 153 | + |
| 154 | +___ |
| 155 | + |
| 156 | +### mode |
| 157 | + |
| 158 | +• `Readonly` **mode**: [*Mode*](../modules.md#mode)= 'entry' |
| 159 | + |
| 160 | +'entry' mode will dispense each entry of each stream |
| 161 | +'stream' mode will dispense each stream containing entries |
| 162 | +'batch' mode will dispense all streams with all entries |
| 163 | + |
| 164 | +Defined in: [stream.ts:25](https://github.com/calebboyd/pez/blob/557aceb/src/stream.ts#L25) |
| 165 | + |
| 166 | +___ |
| 167 | + |
| 168 | +### noack |
| 169 | + |
| 170 | +• **noack**: *boolean*= false |
| 171 | + |
| 172 | +Defined in: [stream.ts:33](https://github.com/calebboyd/pez/blob/557aceb/src/stream.ts#L33) |
| 173 | + |
| 174 | +___ |
| 175 | + |
| 176 | +### pendingAcks |
| 177 | + |
| 178 | +• **pendingAcks**: *Map*<*string*, *string*[]\> |
| 179 | + |
| 180 | +Acks waiting to be sent on either: |
| 181 | +- timeout |
| 182 | +- async iteration |
| 183 | + |
| 184 | +Defined in: [stream.ts:46](https://github.com/calebboyd/pez/blob/557aceb/src/stream.ts#L46) |
| 185 | + |
| 186 | +___ |
| 187 | + |
| 188 | +### streams |
| 189 | + |
| 190 | +• **streams**: *Map*<*string*, *string*\> |
| 191 | + |
| 192 | +Defined in: [stream.ts:31](https://github.com/calebboyd/pez/blob/557aceb/src/stream.ts#L31) |
| 193 | + |
| 194 | +## Methods |
| 195 | + |
| 196 | +### [Symbol.asyncIterator] |
| 197 | + |
| 198 | +▸ **[Symbol.asyncIterator]**(): *AsyncIterator*<T *extends* *entry* ? XEntryResult : T *extends* *batch* ? XStreamResult[] : XStreamResult, *any*, *undefined*\> |
| 199 | + |
| 200 | +**Returns:** *AsyncIterator*<T *extends* *entry* ? XEntryResult : T *extends* *batch* ? XStreamResult[] : XStreamResult, *any*, *undefined*\> |
| 201 | + |
| 202 | +Defined in: [stream.ts:117](https://github.com/calebboyd/pez/blob/557aceb/src/stream.ts#L117) |
| 203 | + |
| 204 | +___ |
| 205 | + |
| 206 | +### ack |
| 207 | + |
| 208 | +▸ **ack**(`stream`: *string*, ...`ids`: *string*[]): *void* |
| 209 | + |
| 210 | +#### Parameters: |
| 211 | + |
| 212 | +Name | Type | |
| 213 | +------ | ------ | |
| 214 | +`stream` | *string* | |
| 215 | +`...ids` | *string*[] | |
| 216 | + |
| 217 | +**Returns:** *void* |
| 218 | + |
| 219 | +Defined in: [stream.ts:142](https://github.com/calebboyd/pez/blob/557aceb/src/stream.ts#L142) |
| 220 | + |
| 221 | +___ |
| 222 | + |
| 223 | +### quit |
| 224 | + |
| 225 | +▸ **quit**(): *Promise*<*void*\> |
| 226 | + |
| 227 | +**Returns:** *Promise*<*void*\> |
| 228 | + |
| 229 | +Defined in: [stream.ts:131](https://github.com/calebboyd/pez/blob/557aceb/src/stream.ts#L131) |
| 230 | + |
| 231 | +___ |
| 232 | + |
| 233 | +### return |
| 234 | + |
| 235 | +▸ `Protected`**return**(): *Promise*<*IteratorReturnResult*<*void*\>\> |
| 236 | + |
| 237 | +**Returns:** *Promise*<*IteratorReturnResult*<*void*\>\> |
| 238 | + |
| 239 | +Defined in: [stream.ts:151](https://github.com/calebboyd/pez/blob/557aceb/src/stream.ts#L151) |
0 commit comments