Kinh doanh - Marketing
Kinh tế quản lý
Biểu mẫu - Văn bản
Tài chính - Ngân hàng
Công nghệ thông tin
Tiếng anh ngoại ngữ
Kĩ thuật công nghệ
Khoa học tự nhiên
Khoa học xã hội
Văn hóa nghệ thuật
Sức khỏe - Y tế
Văn bản luật
Nông Lâm Ngư
Kỹ năng mềm
Luận văn - Báo cáo
Giải trí - Thư giãn
Tài liệu phổ thông
Văn mẫu
Giới thiệu
Đăng ký
Đăng nhập
Tìm
Danh mục
Kinh doanh - Marketing
Kinh tế quản lý
Biểu mẫu - Văn bản
Tài chính - Ngân hàng
Công nghệ thông tin
Tiếng anh ngoại ngữ
Kĩ thuật công nghệ
Khoa học tự nhiên
Khoa học xã hội
Văn hóa nghệ thuật
Y tế sức khỏe
Văn bản luật
Nông lâm ngư
Kĩ năng mềm
Luận văn - Báo cáo
Giải trí - Thư giãn
Tài liệu phổ thông
Văn mẫu
Thông tin
Điều khoản sử dụng
Quy định bảo mật
Quy chế hoạt động
Chính sách bản quyền
Giới thiệu
Đăng ký
Đăng nhập
0
Trang chủ
Công Nghệ Thông Tin
Đồ họa - Thiết kế - Flash
Test Driven JavaScript Development- P17
Đang chuẩn bị liên kết để tải về tài liệu:
Test Driven JavaScript Development- P17
Thái Hồng
83
20
pdf
Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ
Tải xuống
Test Driven JavaScript Development- P17:This book is about programming JavaScript for the real world, using the techniques and workflow suggested by Test-Driven Development. It is about gaining confidence in your code through test coverage, and gaining the ability to fearlessly refactor and organically evolve your code base. It is about writing modular and testable code. It is about writing JavaScript that works in a wide variety of environments and that doesn’t get in your user’s way. | 13.1 Polling for Data 313 Next up Listing 13.32 makes sure the url property is set on the poller. In order to make this assertion we need a reference to the poller object so the method will need to return it. Listing 13.32 Expecting the url property to be set test should set url property on poller object function var poller ajax.poll url assertSame url poller.url Implementing this test requires two additional lines as in Listing 13.33. Listing 13.33 Setting the URL function poll url options var poller Object.create ajax.poller poller.url url poller.start return poller The remaining tests will simply check that the headers callbacks and interval are set properly on the poller. Doing so closely resembles what we just did with the underlying poller interface so I ll leave writing the tests as an exercise. Listing 13.34 shows the final version of ajax.poll. Listing 13.34 Final version of ajax.poll function poll url options var poller Object.create ajax.poller poller.url url options options poller.headers options.headers poller.success options.success poller.failure options.failure poller.complete options.complete poller.interval options.interval poller.start return poller ajax.poll poll Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. From the Library of WoweBook.Com 314 Streaming Data with Ajax and Comet 13.2 Comet Polling will definitely help move an application in the general direction of live by making a more continuous data stream from the server to the client possible. However this simple model has two major drawbacks Polling too infrequently yields high latency. Polling too frequently yields too much server load which may be unnecessary if few requests actually bring back data. In systems requiring very low latency such as instant messaging polling to keep a constant data flow could easily mean hammering servers frequently enough to make the constant requests a scalability issue. When the traditional polling strategy becomes a problem
TÀI LIỆU LIÊN QUAN
Test-Driven JavaScript Development
Test Driven JavaScript Development- P1
Test Driven JavaScript Development- P2
Test Driven JavaScript Development- P3
Test Driven JavaScript Development- P4
Test Driven JavaScript Development- P5
Test Driven JavaScript Development- P6
Test Driven JavaScript Development- P7
Test Driven JavaScript Development- P8
Test Driven JavaScript Development- P9
crossorigin="anonymous">
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.