Giter Site home page Giter Site logo

stream-net's People

Contributors

amila17 avatar kgamecarter avatar murugaratham avatar shawnspeak avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

stream-net's Issues

Not disposing HttpClient, making it static.

With the recent articles regarding the state of HttpClient and abusing disposable on it, I was taking a look at the source. I would like to suggest to implement a static reference for the HttpClient combined with the lazy property. With stream-net always having the same base address, no modifications for the headers it seems to me this is a perfect situation where not to dispose the HttpClient in order to improve performance of socket reuse. Now that I moved al the stream-net calls to azure functions I like to limit the duration times of said functions. Recreating the HttpClientis very time consuming and performance suffers from this.

I would be happy to add a pull request if you're open to it.

Ref:
https://docs.microsoft.com/en-us/azure/architecture/antipatterns/improper-instantiation/
https://contrivedexample.com/2017/07/01/using-httpclient-as-it-was-intended-because-youre-not/

Edit, just noticed ServicePointManager.FindServicePoint(GetBaseUrl()).ConnectionLeaseTimeout =is not possible in .NetCore. According to https://github.com/dotnet/corefx/issues/11224 solution could be refreshing the client every hour in case a DNS change has happened, as shown in the url.

Activities for posting messages TO

Hi, Shawn,

I hope you don't mind, since I am new to social feeds and following stuff. I have some more questions.

Can you show me a syntax example on how to do an activity, to post a message TO someone else?

Similar to the below code, but using your stream-net client:

// specifying additional feeds to push the activity to using the to param
// especially usefull for notification style feeds
to = ['user:2', 'user:3'];
activity = {'to': to, 'actor': 1, 'verb': 'tweet', 'object': 1, 'foreign_id': 'tweet:1'};

The reason I am asking, is we want to have user 1 go to user 2's feed and post a message.
When that happens we want user 1's feed to receive the post, so all user 1's followers see it and we want it to show up in user 2's feed and have all user 2's followers see it.

Can we accomplish that with the TO functionality?

Unit testing with StreamClient

StreamClient is currently a bottleneck in unit testing. Can you consider making the public methods of the following classes virtual, or Extract interfaces for all public methods?

  1. StreamClient
  2. StreamFeed
  3. BatchOperations

Using AddAcitivity with .NET

Hi!

Can you enlighten me with working with AddActivity please? I'm using VB and would like to know how can include other data like "tweet" and all other contents.

Thanks in advance!

Dim actlike = New Activity("Alex", "comment", "post:4b93b75c-378e-11e8-9926-128899f22c76") With {
            .ForeignId = "comment:2979ad56-377e-11e8-9696-0ad650757e1c",
            .Time = Now.ToUniversalTime,
            .To = {"notification:eric"}
        }

Need Help

Hi,

I am using https://github.com/shawnspeak/stream-net c# library
How can I get single users aggregated feed using this library?

How to get likes and comments of a single activity?
If I use this library's GetActivities function it returns like and comment within feed, but what I need is likes and comments on that activity.

JsonSerializationException when getting following feeds

When calling StreamFeed.Following with no parameters, I'm getting the following exception:

Newtonsoft.Json.JsonSerializationException: 'Error converting value {null} to type 'System.DateTime'. Path 'results[0].updated_at', line 1, position 232.'

Looking at the response from GetStream, it looks like updated_at is null:

{
 "feed_id": "user:aggregate-dev-2942a2fa-fa7a-46b1-b11a-229ee95f8818-aggregate2",
 "target_id": "user:c1de77da-b521-4af6-9589-7498c66b163d",
 "created_at": "2017-12-12T19:57:49.768087Z",
 "updated_at": null
}

This same code seemed to work not long ago (a month maybe?). Do you know if something in the GetStream api changed recently?

Unable to get custom fields.

Able to add custom fields value to api, but unable to get custom fields value from api. I am very new getstream, is there any doc that can help me. Is this available in paid version?

AddActivity error :The request was aborted: Could not create SSL/TLS secure channel.

I recently transfered all the calls with stream-net to Azure Functions (Queue triggers). With version 1.3.2 everything worked like a charm, however when updating the nuget package to 2.0.1 in order to use the new api points I get this message:

The request was aborted: Could not create SSL/TLS secure channel.
at System.Net.HttpWebRequest.EndGetRequestStream(IAsyncResult asyncResult, TransportContext& context)
at System.Net.Http.HttpClientHandler.GetRequestStreamCallback(IAsyncResult ar)

The funny thing is, if I run a small project locally to use AddActivity, everything goes well.

If I use ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12; just before I call StreamClient GetStreamsClient = new StreamClient("xxx","xxx"); it does work.

So a heads up to developers running into this issue with azure functions & stream-net.

Ps great stuff Shawn!

Supporting other regions

Currently the stream options only support us east, can you include the other regions like north east Asia?

Activities for Video and Images

Hi Shawn,

Great stuff with your steam-net client.

Hope your having a great day.

Couple questions:

Activities with non YouTube videos:

To do an activity and share a video that is not on YouTube, using yourstream-net client.

GetStreamIo has the following example posted for sharing YouTube videos:

addActivity({actor: 'eric', verb: 'watch', object: 1, youtube_id: 'z_AbfPXTKms'}

But what if the video is not on YouTube and say the video resides some where else. What if we want that activity to show an image of the video but have the image link to the video url.

How would add that activity using your stream-net client?

Activities with sharing pictures:

We want to do an activity that shares a picture, using stream-net client.

How do we do that?

Thank you for your time in reading this message and the time it takes to create the detailed response.

Have a great day and great weekend.

Regards,

Patrick Rosenberg

Add support for the Unfollows keep_history parameter

The getstream.io API supports a keep_history parameter for the Unfollows API call - this allows for unfollowing a feed without removing all of the activities that have already been added from the followed feed. This issue is to add support for keep_history in stream-net.

state of the client

Hi there,
I am Tommaso CTO of getstream.io. Awesome that you built a .net API client! Are you already using the client on your application? Feel free to ping on [email protected] to talk about the client ;)

Null reference exceptions are thrown

If an exception occurs during a getstream.io request, but it is not an exception that results in a getstream.io exception response - for example, if the request to getstream.io times out, then stream-net throws a NullReferenceException because it attempts to get the exception state from the empty response.

Note: I am going to submit a pull request for the fix today.

Anyone use within Unity Editor?

Hello, wondering if anyone has tried using this in Unity Editor and knows how to make it work. I got the code to compile, but has a runtime error within Unity

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.