This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Tambur = tambur_client:new(MY_API_KEY, MY_APP_ID, SECRET). | |
| Tambur:publish("test_stream", "some message"). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var connection = new tambur.Connection(MY_API_KEY, MY_APP_ID); | |
| connection.ready = function() { | |
| var stream = connection.get_stream("mystream"); | |
| stream.onmessage = function(msg) { | |
| /* do something fancy with the msg */ | |
| }; | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| %% pretty print timestamp from lager/src/lager_utils.erl | |
| localtime_ms() -> | |
| {_, _, Micro} = Now = os:timestamp(), | |
| {Date, {Hours, Minutes, Seconds}} = calendar:now_to_local_time(Now), | |
| {Date, {Hours, Minutes, Seconds, Micro div 1000 rem 1000}}. | |
| format_time() -> | |
| format_time(localtime_ms()). |
NewerOlder