首页 \ 问答 \ Firebase云消息传递可靠性(Firebase Cloud Messaging Reliability)

Firebase云消息传递可靠性(Firebase Cloud Messaging Reliability)

我们正在构建一个消息传递应用程序,我们正面临着消息传递问题。

我们目前正在使用socket.io在正在运行的应用程序上发送消息,但事实证明它非常不可靠。 (网络速度慢,超时延迟,应用程序处于打盹模式时出现问题,......)

我们正在考虑转向FCM,但我们对可靠性和速度有疑问。 我们不想改变一切,以后看到它不像想要的那样可靠。

您是否已在生产应用中为每条消息使用FCM? 即使应用程序正在运行?


We are building a messaging app and we are facing issues with messages delivery.

We are currently using socket.io to send messages on a running app but it's been proven highly unreliable. (Problem with slow network, late timeout, problem when app is in Doze mode,...)

We are thinking about switching to FCM but we have questions regarding reliability and speed. We don't want to change everything to see afterwards that it's not as reliable as wanted.

Have you already used FCM on a production app for every message ? Even when the app is running ?


原文:https://stackoverflow.com/questions/43000510
更新时间:2022-05-11 07:05

最满意答案

如果您翻转类型,可能会更容易看到:

(e -> a) -> (a -> b) -> (e -> b)

我们可以把e变成a ,把a变成b 。 那么我们怎样才能把e变成b呢?

不要过分关注“提升”; 使用Functor实例,发现实现的最佳方法就是遵循类型。


It may be easier to see if you flip the types around:

(e -> a) -> (a -> b) -> (e -> b)

We can turn an e into an a, and an a into a b. So how can we turn an e into a b?

Don't focus too much on "lifting"; with Functor instances, the best way to discover the implementation is simply to follow the type.

相关问答

更多
  • 是否有已经定义的mmap ? 叫什么? Hoogle是你的朋友。 (>>=)的类型签名是: (>>=) :: Monad m => m a -> (a -> m b) -> m b 因此,你正在寻找一个类型签名的函数: flip (>>=) :: Monad m => (a -> m b) -> m a -> m b 这实际上是=<<功能。 因此,你可以写fun3 =<< fun2 =<< fun1 。 为什么绑定被定义为一个运算符,其参数的顺序是反向的? 这是因为单代码看起来很像命令式代码。 例如,请 ...
  • 我想提出一个答案,提请注意上面八月的评论: 实际上并不是这样。 发生了什么事情是地图的类型被概括为覆盖Haskell 1.3中的Functor。 即,在Haskell 1.3中,fmap被称为地图。 然后,这个更改在Haskell 1.4中被还原,并引入了fmap。 这种变化的原因是教学性的; 当教给Haskell初学者时,非常一般的地图类型的错误信息更难理解。 在我看来,这不是解决问题的正确方法。 Haskell 98被一些Haskellers(包括我)退后一步,以前的版本定义了一个更抽象和一致的库。 好 ...
  • 关键在这里: fmap (*) 3 :: (Functor f, Num a, Num (f a)) => f (a -> a) ^^^^^^^^^ 在Haskell中,数字文字被重载,因此只要b具有Num实例, 3就可以有任何类型b 。 编译器进行以下分析: 3具有约束Num b某种类型Num b fmap类型为Functor f => (a -> c) -> fa -> fc 所以*有类型a -> c ,3有类型fa *具有类型Num ...
  • 您忘记在Branch节点中包含a s上应用函数f ,否则您只将函数应用于叶子上。 而且,你忘记了Empty构造函数的情况。 instance Functor Tree where fmap f Empty = Empty fmap f (Leaf x) = Leaf (f x) fmap f (Branch a left right) = Branch (f a) (fmap f left) (fmap f right) You are forgetting to apply the func ...
  • 您只写Just 1而不是(Just 1) ,因此,这些是两个独立的参数。 现在我们可以用更规范的形式重写它,如: (fmap . fmap) (+1) Just 1 -> (\x -> fmap (fmap x)) (+1) Just 1 -> ((fmap (fmap (+1)) Just) 1 所以现在我们可以分析类型: fmap1 :: Functor f => (a -> b) -> f a -> f b fmap2 :: Functor g => (c -> d) -> g c -> g ...
  • 这是因为xs是Rose a的列表。 也许这更清楚: fmap f (x :> xs) = (f x) :> map (fmap f) xs ^^^ 当然,对于列表, map = fmap 。 那是: 将f应用于x 。 对于xs ,将函数fmap f映射到列表xs It's because xs is a list of Rose a. Perhaps this is clearer: fmap f (x :> xs) = (f x) :> map ( ...
  • (+3) (+3)只是一个类型错误,因此它不会编译。 (+3)的类型是Int -> Int ,这意味着当应用Int ,我们得到另一个Int 。 它还意味着您只能应用Int类型的值! 因此,您不能将(+3)类型的值应用于Int -> Int ,只能应用Int类型的值。 所以,是的, (+3)是值,但不适合将类型应用于期望类型为Int的值的函数。 Int不能与Int -> Int统一,因为它们具有不同的类型构造函数 ,这使它们成为不同的类型,正如@DanielWagner所指出的那样。 Int -> Int的最 ...
  • 我们通常不能在fmap方面实现return 。 Monad比Functor更强大。 但是,作为练习,我们可以尝试提出这个问题:如果有的话,第二个操作是否可以实现fmap return ? 我们可以通过查看类型来攻击这个问题。 (我们将使用Applicative类中的pure而不是return它们基本上是相同的操作。) fmap :: Functor f => (a -> b) -> f a -> f b pure :: Applicative f => a -> f a 嗯,这可能是一种可能的方式,如果我 ...
  • 如果您翻转类型,可能会更容易看到: (e -> a) -> (a -> b) -> (e -> b) 我们可以把e变成a ,把a变成b 。 那么我们怎样才能把e变成b呢? 不要过分关注“提升”; 使用Functor实例,发现实现的最佳方法就是遵循类型。 It may be easier to see if you flip the types around: (e -> a) -> (a -> b) -> (e -> b) We can turn an e into an a, and an a int ...
  • 您可以使用Data.Functor.Compose将嵌套的Data.Functor.Compose / Applicatives视为单个Functor / Applicative: ghci> import Data.Functor.Compose ghci> getCompose (Compose [pure (+2), pure (*2)] <*> Compose [Just 10, Just 20]) [Just 12,Just 22,Just 20,Just 40] 但在这种情况下,( Compo ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)