Giter VIP home page Giter VIP logo

Comments (4)

abdolence avatar abdolence commented on May 18, 2024 2

@nhey there is no need to mark it Copy in this case I think (and I don't think it will work if you try).
However I've fixed Send + Sync in the scroller implementation and released it in v0.8.5.
Thanks for the detailed report.
By the way, I would recommend to use to_items_throttled_stream IRL, instead of just to_items_stream in your example, because you will end up really quickly with Slack rate limitation errors.

from slack-morphism-rust.

abdolence avatar abdolence commented on May 18, 2024

Hey @nhey , seems like it was forgotten to mark as Send, I'll check it a bit later today and will fix.

from slack-morphism-rust.

abdolence avatar abdolence commented on May 18, 2024

Thanks for the report!

from slack-morphism-rust.

nhey avatar nhey commented on May 18, 2024

Thanks. I think in some places it could be marked Clone as well?
Here's my diff with regards to Send + Sync FWIW, but there may be other places:

diff --git a/src/client/src/scroller.rs b/src/client/src/scroller.rs
index 978056e..186e45a 100644
--- a/src/client/src/scroller.rs
+++ b/src/client/src/scroller.rs
@@ -48,7 +48,7 @@ where
                 ResponseType = Self::ResponseType,
                 CursorType = Self::CursorType,
                 ResponseItemType = Self::ResponseItemType,
-            > + 'b,
+            > + Send + Sync + 'b,
     >
     where
         Self: Send + Clone + Sync + 'b,
diff --git a/src/hyper/src/scroller_ext.rs b/src/hyper/src/scroller_ext.rs
index 75f8a23..d6405d0 100644
--- a/src/hyper/src/scroller_ext.rs
+++ b/src/hyper/src/scroller_ext.rs
@@ -9,7 +9,7 @@ use std::time::Duration;
 use tokio_stream::StreamExt;

 pub trait SlackApiResponseScrollerExt<SCHC, CT, RT, RIT>:
-    SlackApiResponseScroller<SCHC, CursorType = CT, ResponseType = RT, ResponseItemType = RIT>
+    SlackApiResponseScroller<SCHC, CursorType = CT, ResponseType = RT, ResponseItemType = RIT> + Send + Sync
 where
     SCHC: SlackClientHttpConnector + Send + Sync,
     RT: Send + Clone + Sync + SlackApiScrollableResponse<CursorType = CT, ResponseItemType = RIT>,
@@ -34,7 +34,7 @@ impl<SCHC, CT, RT, RIT> SlackApiResponseScrollerExt<SCHC, CT, RT, RIT>
         CursorType = CT,
         ResponseType = RT,
         ResponseItemType = RIT,
-    >
+    > + Send + Sync
 where
     SCHC: SlackClientHttpConnector + Send + Sync,
     RT: Send + Clone + Sync + SlackApiScrollableResponse<CursorType = CT, ResponseItemType = RIT>,

from slack-morphism-rust.

Related Issues (20)

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.