The operations key requires two arguments which is `$this` and `process`. The variable should have key ‘operations’ to tell the Drupal that this will be the datas will processed. Drupal provides an API which the data will temporarily stored and processed. The next step is the main point of article is to show how to hande queue. įgetcsv is a function from php that reads file in csv format, it scans all the data from first row until to the last row. Once the csv was successfully fetched, count the total row and get the header data. The first step is fetch the csv file from public folder which is located from ’,’r’) įetching csv is pretty much easy as long as you know where the csv files is located. It is also possible that the temporary data stored is the actual data from csv per row but this will compromised the server performance. The header holds the data as a key and body holds the actual data just like on spreadsheet table,ĭuring the operation ,The row number of csv will be temporary stored on queue for process. CSV if type of file that stores data that has header and body. In this example, the queue was being used for importing contents from csv file. When queue is not develop by Drupal, it will probably display error message of Allowed memory size X bytes exhausted When progress bar is displayed, the Drupal Queue was being used since there are a lot of operations happen at background process. Some modules during installation requires translation to update or sometimes requires dependency. It means some data is temporarily stored on database instead on RAM for operations like installing module. A 4Gb RAM server without Drupal queue API can be achieve with 1Gb RAM with queue. The reason why queue is very important because it will optimize the usage of server since less resources means less cost. Since Drupal provides backend service, we are gonna try on how to handle queue using Drupal API. In web backend aspect, queue is very important both frontend and backend web development. Basically something has to wait for a process. According to the dictionary, Queue is a verb that makes things lineup or wait.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |