小编akn*_*320的帖子

在Haskell中键入System

我无法理解为什么以下代码会导致错误.如果第二个字段Foo更改为type Int,则代码运行时没有错误.

Prelude> data Foo = Foo {foo_a :: Int, foo_b :: Float}
Prelude> let x = Foo 2 3.4
Prelude> unwords $ map (\fn -> (show . fn) x) [foo_a, foo_b]

<interactive>:4:46:
    Couldn't match type `Float' with `Int'
    Expected type: Foo -> Int
      Actual type: Foo -> Float
    In the expression: foo_b
    In the second argument of `map', namely `[foo_a, foo_b]'
    In the second argument of `($)', namely
      `map (\ fn -> (show . fn) x) …
Run Code Online (Sandbox Code Playgroud)

haskell

11
推荐指数
2
解决办法
351
查看次数

用gunicorn流媒体

我正在尝试从flask/gunicorn服务器传输数据:

while (True):
    result = json.dumps(tweetQueue.get())
    yield result
Run Code Online (Sandbox Code Playgroud)

然而,在流中30秒后,gunicorn超时我的连接并停止流.如何进行超时,以便从服务器向流中发布新数据将重新启动超时,以便流不会被终止?

谢谢!

python streaming timeout flask gunicorn

3
推荐指数
1
解决办法
2316
查看次数

标签 统计

flask ×1

gunicorn ×1

haskell ×1

python ×1

streaming ×1

timeout ×1