Truxton etl destroy

From truxwiki.com
Revision as of 05:04, 26 May 2020 by Sam (talk | contribs) (Created page with "This is the last thing an ETL process does before exitting. =Syntax= <syntaxhighlight lang="C"> void truxton_etl_destroy( uint64_t etl_handle ); </syntaxhighlight> =Paramete...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This is the last thing an ETL process does before exitting.

Syntax

void truxton_etl_destroy( uint64_t etl_handle );

Parameters

etl_handle

The handle created by the truxton_etl_create call.

Sample

 1 #include <TruxtonCAPI.h>
 2 #pragma hdrstop
 3 
 4 void main( void )
 5 {
 6     char file_id[ 65 ];
 7 
 8     int exit_loop = 0;
 9 
10     uint64_t message = 0;
11     uint64_t app = truxton_etl_create();
12 
13     truxton_etl_set_application_name( app, "Sample C ETL" );
14     truxton_etl_set_stage_number( app, 42 );
15     truxton_etl_set_queue_name( app, "SampleC" );
16 
17     while( exit_loop == 0 )
18     {
19         message = truxton_etl_get_message( app );
20 
21         if ( message != 0 )
22         {
23             // Do something with the message
24 
25             memset( file_id, 0x00, sizeof( file_id ) );
26             truxton_message_get_file_id( message, file_id, sizeof( file_id ) );
27 
28             printf( "Received file id %s\n", file_id );
29 
30             truxton_message_destroy( message );
31         }
32         else
33         {
34             exit_loop = 1;
35         }
36     }
37 
38     truxton_etl_destroy( app );
39 }