Enabling webhooks in Pybossa without enabling SSE - asynchronous

I have been working with the Webhooks in Pybossa. According to their documentation (Enabling Server Sent Events), for enabling webhooks, we need to execute Pybossa in asynchronous mode with SSE enabled. But, running Pybossa in asynchronous mode carries with it many issues. Is there any way to enable Webhooks with SSE disabled?

You don't need to enable SSE for webhooks. That's only to get a better experience when debugging webhooks from the PYBOSSA server. Disable them, and run normally. SSE is only used to not force to reload the webhooks admin page so you can deploy payloads to your webhooks server without reloading the entire page. Nothing else.

Related

Can Firestore JS SDK onSnapshot listeners work over an http proxy?

I use the firestore js sdk in my web app, and faced a problem: some of my users are behind a firewall that blocks firebase urls (https://firebase.googleapis.com/, https://firestore.googleapis.com/, etc ) that the sdk talks to.
I plan to solve it by adding a service worker to intercept all requests to these urls, then forward them to my own server, which will then pass the requests to the firebase urls, and pass back the responses.
I imagine it could work, but I'm not sure if onSnapshot listeners will work too. I don't know the mechanism of the onSnapshot listeners, but I imagine WebSockets or gRPC are involved, but when I look at the devTools, I didn't see any WebSockets or gRPC traffic when I trigger the listener.
In any case, I want to know if my service worker + reverse proxy approach would work. Thanks!
You should try to use a proxy server, take a look at this page:
https://faun.pub/firebase-accessing-firestore-and-firebase-through-a-proxy-server-c6c6029cddb1

Twilio sandbox webhook url returning timeout execution error

can anyone please tell me how to increase timeout for twilio sandbox http post url.
I am trying to building one programmable chat application using whatsapp twilio sandbox using asp.net technology.
Normally my application methods takes 20 plus seconds to run but when i did same thing on twilio sandbox then its returning execution timeout error.
is there any way to increase timeout for twilio sandbox using .net.
Twilio developer evangelist here.
The Twilio webhook timeout is 15 seconds and it can't be changed.
Web applications that take 20+ seconds to respond to incoming requests are not recommended in general. They ties up processes and resources on your server and may lead to other requests being dropped.
I would recommend you do whatever work that takes more than 20 seconds in a background worker outside of the main web process. You can then respond to the webhook quickly, with an empty response and then use the REST API to send your reply message once the work is done.

How do I communicate / trigger a Webtask from Firebas?

In an interesting blogpost about 'Firebase Authentication with the Firebase 3.0 SDK and Auth0 Integration', it is stated that:
You can even have Firebase communicate with Webtask!
Now I can imagine the (web)client triggering a Firebase operation and subsequently a Webtask, but not the other way around. Or am I missing something?
Firebase can run as a serverless app, but it can also run on the server. You can even have Firebase communicate with Webtask! (sic!)
I think that paragraph is misleadingly phrased, perhaps it was just added at the last minute to spark interest. You can have a webtask communicate with Firebase, not the other way around. You don't "run Firebase" on your server either.
TL;DR: A client application may call a webtask with an HTTP request, and that task can read/write the database, but not in any other order.
Here's a quick and dirty reality check as of Nov. 2016:
The Realtime Database by itself does not provide you with a way of executing code. This includes responding to database changes and user requests, handling fan-in and fan-out operations, etc. There is no support for webhooks either.
Which means you have to provide your own execution environment for such logic on a custom server, or you can try to cram as much as possible into the client code. This is a pretty exhaustive topic by itself.
Webtasks are short-lived functions that respond to HTTP requests. Their lifecycle always starts with a request, so they are not fit for continuously watching the database for changes. But they are perfectly valid for handling requests coming in from your client application.
As you can store "secrets" for the webtasks, you can authenticate the task on an admin access level. This gives you the possibility to verify client tokens – which should be sent along with the request –; perform complex authorization and validation, and perform RTDB write operations you wouldn't trust the clients with.
Or trigger external services securely. The possibilities are close to endless.

Difference between ASP.NET WebHooks and Signal-R

What is the difference between the newly release ASP.NET WebHooks and Signal-R? What are the advantages or disadvantages? What are the use cases for each technology?
SignalR is for notification within an ASP.NET app using WebSockets. You can exchange event notifications through WebSockets, however it requires a constant network connection.
WebHooks are for event notification across other web applications and other external services. (Think B2B communication). For instance, you can receive a WebHook when someone sends you money to your PayPal account. PayPal fires off a POST request to your predefined URL handler and then your app does something with that notification. You pre-configure everything on the PayPal side first. You also set up an application to handle the incoming POST request. The event notification is "pushed" to you in (near) real-time. No need to hold open a network connection while waiting for events.
The two can be complementary. For example, when you receive the WebHook from PayPal, you can notify a logged in user on your webapp (using SignalR/WebSockets) that money has been received successfully.
TLDR: Event notification across different web applications
It really depends on service you want to integrate with and how. WebHooks is a simple pattern for integrating event notifications across different SaaS services. If the service you want to integrate with supports WebHooks then you can use that. If it supports SignalR then you can use that. In that sense the two are quite complementary.
Check Henrik F Nielsen post at
http://blogs.msdn.com/b/webdev/archive/2015/09/04/introducing-microsoft-asp-net-webhooks-preview.aspx

Workflow Foundation - Pending Timers on Server Restart

I have a workflow built in a way that it has delay activity which causes it to persist, and after delay has expired, a notification is sent. Workflow is exposed via Workflow Services.
This works perfect except for the scenarios when the server restart occurs or server is brought down for a maintenance for a day or two and timers were already expired. In that case, notification is not sent until the first request related to particular workflow arrives to WCF endpoints.
I have to mention that application pool is already set to alwaysRunning.
Is there anything else that has to be added for IIS/AppFabric to check pending timers that should have already been executed?
I'm using Workflow Foundation 4.5.
Issue has been caused by AppFabric not being set properly.

Resources