1

In reading over the API documentation it's not clear to me when I should be using client.subscribe versus datasift.push.create_from_hash.

In digging into the source code, they appear to be doing different things under the hood.

Are they interchangeable?

2 Answers2

1

client.subscribe is used to subscribe to a stream using websockets, while push.create_from_hash is used to create a Push connector to send you the data using other connectors

  • So what is the answer to "are they interchangeable"? Any additional information on the differences between the two would also help. – ryanyuyu Apr 17 '15 at 14:46
  • They provide two different delivery mechanisms as Andi mentioned. Take a look at the section in DataSift's documentation on [What's the difference between Push and Streaming?](http://dev.datasift.com/docs/push). Push (so the ```datasift.push.create_from_hash``` method) tends to be the recommended delivery mechanism as DataSift can guarantee delivery here. – Jason Apr 22 '15 at 11:47
1

This has been answered on the Datasift community forum here.

The client.subscribe method will start a connection using our streaming service, whereas datasift.push.create_from_hash will create a delivery job using our robust push delivery service. Push will send the data directly to a specified destination.

Moozla
  • 46
  • 2