Block libraries which are useful for IoT application development in general are collected within the IoT Development Kit Team. This team is public, so you can join this team to be able to import the included libraries.
You will find the following libraries:
Many applications include a producer and consumer of some data, which do not necessarily work synchronously. Then the data has to be buffered in between.
This following system is from the Send Multiple Emails tutorial:
The block Emails Generator produces emails, which are going to be sent by block Send Email. However, sending an email may take some time. Therefore the produced emails are stored within Buffer Eager Simple and processed one at time by the consuming block Send Email.
To use a buffer from the library:
All buffers are suitable for storing data between a producer and a consumer. However, you’ll find some differences in the behaviour of the Buffering library blocks:
The simple and advanced version of a buffer behave very similar. The advanced buffers provide more functionality:
Usually it is a good idea to start with one of the Simple buffers and switch to the more advanced one in case more functionality is needed.
From your application you will usually know if to use an Eager or a Lazy buffer. Eager means that these buffers will push out the first added element without being asked. Lazy means that no element is going to be pushed out unless you ask for it via pin next. Eager and Lazy buffers have the same pins, however they behave differently as you can see by their contracts: