Talk:Event Platform/EventStreams HTTP Service
Appearance
From Wikitech
Latest comment: 4 years ago by KSiebert in topic too many requests
Elixir client
I wrote a streaming parser for Elixir, but wasn't sure whether I should add it to the "examples" section of this page, or perhaps there's a longer list of Wiki SSE clients somewhere else?
Example code depending on the wiki_elixir library:
defmoduleEchoSSEdo defstart(:normal,[])do WikiSSE.start_link(&EchoSSE.echo_event/1) end @doc""" Example callback prints a summary of each message. """ defecho_event(message)do data=Poison.decode!(message.data) casedata["type"]do "edit"-> IO.puts~s(#{data["meta"]["dt"]}: #{data["wiki"]}#{data["title"]} edited by #{data["user"]}) _-> IO.puts~s(#{data["meta"]["dt"]}: #{data["type"]} event: #{message.data}) end end end
too many requests
{"status":429,"type":"too_many_requests","title":"Too Many Concurrent Connections From Your Client IP","detail":"Your HTTP client is likely opening too many concurrent connections.","method":"GET","uri":"/v2/stream/page-delete,page-move,page-undelete,revision-create?since=2020年07月04日T21%3A54%3A21Z"}
Wondering, how I can handle this error. I am running it from the cloud, so I cannot control the number of connections. --Wurgl (talk) 22:15, 4 July 2020 (UTC) Reply
- Quite a bit later I am also wondering how to resolve this, did you find a workaround? KSiebert (talk) 08:49, 10 June 2022 (UTC) Reply