Version 1.0 of our new Lightstreamer Client SDK for the OS X platform is now available.
The OS X client library is directly derived from the iOS client library, with which is API compatible. It supports automatic reconnection, automatic resubscription, stream sensing and advanced thread pooling just like the iOS one.
A sample application is included, with full source code, which displays our classical stock list demo.
Connecting with Lightstreamer with our new SDK could not be easier: create your client, create your connection info and open the connection:
_client= [[LSClient alloc] init];
LSConnectionInfo *connectionInfo= [LSConnectionInfo
connectionInfoWithPushServerURL:SERVER_URL
pushServerControlURL:nil
user:nil password:nil
adapter:@"DEMO"];
[_client openConnectionWithInfo:connectionInfo delegate:self];
You may then proceed with a table subscription by creating your table info and subscribing with your client:
LSExtendedTableInfo *tableInfo= [LSExtendedTableInfo
extendedTableInfoWithItems:_itemNames
mode:LSModeMerge
fields:_fieldNames
dataAdapter:@"QUOTE_ADAPTER"
snapshot:YES];
_tableKey= [_client
subscribeTableWithExtendedInfo:tableInfo
delegate:self
useCommandLogic:NO];
Recall that Lightstreamer client libraries may throw exceptions locally and/or asynchronously via the connection delegate. Be a good citizen and catch exceptions properly.
After your subscription, you will star receiving updates in your table delegate:
- (void) table:(LSSubscribedTableKey *)tableKey
itemPosition:(int)itemPosition
itemName:(NSString *)itemName
didUpdateWithInfo:(LSUpdateInfo *)updateInfo {
// Your update-handling code here
}
If you have any question feel free to write on our forums in the iOS and OS X Client API section. Enjoy!