...
If you only had 20 emails and each email takes a second to query, then a for loop would work fine. But what if you have 100,000 emails? You really need to be able to wake up a component, get a small batch of say 10, iterate and store the next ID and then get the next 10 and so on.
...
Expand | ||
---|---|---|
| ||
See Import a Library if you need a refresher on how to do it. |
Expand | ||
---|---|---|
| ||
Note: You’ll need to change your component to use the DEVELOPMENT commit to see the newly added custom field. See Choosing the code to run for your component. |
...
Expand | ||||||
---|---|---|---|---|---|---|
| ||||||
title | COUNTset saves the new value of the custom field in the custom field value file.
| |||||
Expand | ||||||
This means we can see the NextId in the card view of the component - and we can set it too! | ||||||
Expand | ||
---|---|---|
| ||
You can use component.setTimer{} is used here to run main every 2 seconds. This is a complete little program to increment a custom number field:
|
Expand | ||
---|---|---|
| ||
Expand | ||
---|---|---|
| ||
Remember, the Custom Fields the values for these are stored on disc in JSON. This means we can load and save them programmatically. This is how this library works. |
This is a very useful pattern for lots of Feeder interfaces. It’s used as part of the IMAP Email Feed component.