matthijs2704 / vapor-apns

Simple APNS Library for Vapor (Swift)
MIT License
341 stars 37 forks source link

Any interest in supporting a Vapor Provider? #12

Closed cwoloszynski closed 8 years ago

cwoloszynski commented 8 years ago

I'm looking at this in the context of Vapor and it seems like this is a natural to be used as a Provider.

Have you considered this?

matthijs2704 commented 8 years ago

I have considered this, only problem is that you need to be able to access the instance again, but it's not possible to add a custom variable to the droplet class, so it would be useless to create a provider at the moment. I am looking for other possibilities though

cwoloszynski77 commented 8 years ago

Yes, you are right. I have learned yesterday (from a Slack conversation) that the right approach is to use a Middleware pattern to inject the reference into each request. Provider is not sufficient to do what I was looking to do. I have not yet developed a good solution to configuring the instance using the Vapor configuration tools. That might be just part of the Middleware wrapper I am writing.

You can close this ticket.

matthijs2704 commented 8 years ago

Okay! Yeah Providers are mostly used to provide database drivers and middleware, not really a full plugin driver yet :)