Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(feat) allow Arc wrapped value as middleware #346

Merged
merged 1 commit into from
May 20, 2015
Merged

(feat) allow Arc wrapped value as middleware #346

merged 1 commit into from
May 20, 2015

Conversation

sunng87
Copy link
Contributor

@sunng87 sunng87 commented May 17, 2015

Hi, I was working on live-reload feature on my handlebars-iron middleware. In order to watch the file system and reload template engine, I spawned a dedicated thread waiting for fs events. The middleware is shared in main thread and watcher thread. So I made it wrapped by Arc.

I hope iron could accept Arc wrapped value as BeforeMiddleware and AfterMiddleware. Otherwise, it seems difficult to set an Arc into Chain.

The code with modified iron is here:
https://github.com/sunng87/handlebars-iron/blob/feature/notify/examples/watch_server.rs#L50

If there is a better solution for this scenario, please kindly let me know. :-)

reem added a commit that referenced this pull request May 20, 2015
(feat) allow Arc wrapped value as middleware
@reem reem merged commit 3debc14 into iron:master May 20, 2015
@reem
Copy link
Member

reem commented May 20, 2015

Sounds good to me :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants